//===----------------------------------------------------------------------===//
//
// This source file is part of the Soto for AWS open source project
//
// Copyright (c) 2017-2022 the Soto project authors
// Licensed under Apache License v2.0
//
// See LICENSE.txt for license information
// See CONTRIBUTORS.txt for the list of Soto project authors
//
// SPDX-License-Identifier: Apache-2.0
//
//===----------------------------------------------------------------------===//

// THIS FILE IS AUTOMATICALLY GENERATED by https://github.com/soto-project/soto-codegenerator.
// DO NOT EDIT.

import Foundation
import SotoCore

extension Billingconductor {
    // MARK: Enums

    public enum AssociateResourceErrorReason: String, CustomStringConvertible, Codable, _SotoSendable {
        case illegalCustomlineitem = "ILLEGAL_CUSTOMLINEITEM"
        case internalServerException = "INTERNAL_SERVER_EXCEPTION"
        case invalidArn = "INVALID_ARN"
        case invalidBillingPeriodRange = "INVALID_BILLING_PERIOD_RANGE"
        case serviceLimitExceeded = "SERVICE_LIMIT_EXCEEDED"
        public var description: String { return self.rawValue }
    }

    public enum BillingGroupStatus: String, CustomStringConvertible, Codable, _SotoSendable {
        case active = "ACTIVE"
        case primaryAccountMissing = "PRIMARY_ACCOUNT_MISSING"
        public var description: String { return self.rawValue }
    }

    public enum CurrencyCode: String, CustomStringConvertible, Codable, _SotoSendable {
        case cny = "CNY"
        case usd = "USD"
        public var description: String { return self.rawValue }
    }

    public enum CustomLineItemRelationship: String, CustomStringConvertible, Codable, _SotoSendable {
        case child = "CHILD"
        case parent = "PARENT"
        public var description: String { return self.rawValue }
    }

    public enum CustomLineItemType: String, CustomStringConvertible, Codable, _SotoSendable {
        case credit = "CREDIT"
        case fee = "FEE"
        public var description: String { return self.rawValue }
    }

    public enum PricingRuleScope: String, CustomStringConvertible, Codable, _SotoSendable {
        case billingEntity = "BILLING_ENTITY"
        case global = "GLOBAL"
        case service = "SERVICE"
        public var description: String { return self.rawValue }
    }

    public enum PricingRuleType: String, CustomStringConvertible, Codable, _SotoSendable {
        case discount = "DISCOUNT"
        case markup = "MARKUP"
        case tiering = "TIERING"
        public var description: String { return self.rawValue }
    }

    // MARK: Shapes

    public struct AccountAssociationsListElement: AWSDecodableShape {
        ///  The Amazon Web Services account email.
        public let accountEmail: String?
        ///  The associating array of account IDs.
        public let accountId: String?
        ///  The Amazon Web Services account name.
        public let accountName: String?
        ///  The Billing Group Arn that the linked account is associated to.
        public let billingGroupArn: String?

        public init(accountEmail: String? = nil, accountId: String? = nil, accountName: String? = nil, billingGroupArn: String? = nil) {
            self.accountEmail = accountEmail
            self.accountId = accountId
            self.accountName = accountName
            self.billingGroupArn = billingGroupArn
        }

        private enum CodingKeys: String, CodingKey {
            case accountEmail = "AccountEmail"
            case accountId = "AccountId"
            case accountName = "AccountName"
            case billingGroupArn = "BillingGroupArn"
        }
    }

    public struct AccountGrouping: AWSEncodableShape {
        ///  The account IDs that make up the billing group. Account IDs must be a part of the consolidated billing family, and not associated with another billing group.
        public let linkedAccountIds: [String]

        public init(linkedAccountIds: [String]) {
            self.linkedAccountIds = linkedAccountIds
        }

        public func validate(name: String) throws {
            try self.linkedAccountIds.forEach {
                try validate($0, name: "linkedAccountIds[]", parent: name, pattern: "^[0-9]{12}$")
            }
            try self.validate(self.linkedAccountIds, name: "linkedAccountIds", parent: name, max: 30)
            try self.validate(self.linkedAccountIds, name: "linkedAccountIds", parent: name, min: 1)
        }

        private enum CodingKeys: String, CodingKey {
            case linkedAccountIds = "LinkedAccountIds"
        }
    }

    public struct AssociateAccountsInput: AWSEncodableShape {
        ///  The associating array of account IDs.
        public let accountIds: [String]
        ///  The Amazon Resource Name (ARN) of the billing group that associates the array of account IDs.
        public let arn: String

        public init(accountIds: [String], arn: String) {
            self.accountIds = accountIds
            self.arn = arn
        }

        public func validate(name: String) throws {
            try self.accountIds.forEach {
                try validate($0, name: "accountIds[]", parent: name, pattern: "^[0-9]{12}$")
            }
            try self.validate(self.accountIds, name: "accountIds", parent: name, max: 30)
            try self.validate(self.accountIds, name: "accountIds", parent: name, min: 1)
            try self.validate(self.arn, name: "arn", parent: name, pattern: "^(arn:aws(-cn)?:billingconductor::[0-9]{12}:billinggroup/)?[0-9]{12}$")
        }

        private enum CodingKeys: String, CodingKey {
            case accountIds = "AccountIds"
            case arn = "Arn"
        }
    }

    public struct AssociateAccountsOutput: AWSDecodableShape {
        ///  The Amazon Resource Name (ARN) of the billing group that associates the array of account IDs.
        public let arn: String?

        public init(arn: String? = nil) {
            self.arn = arn
        }

        private enum CodingKeys: String, CodingKey {
            case arn = "Arn"
        }
    }

    public struct AssociatePricingRulesInput: AWSEncodableShape {
        ///  The PricingPlanArn that the PricingRuleArns are associated with.
        public let arn: String
        ///  The PricingRuleArns that are associated with the Pricing Plan.
        public let pricingRuleArns: [String]

        public init(arn: String, pricingRuleArns: [String]) {
            self.arn = arn
            self.pricingRuleArns = pricingRuleArns
        }

        public func validate(name: String) throws {
            try self.validate(self.arn, name: "arn", parent: name, pattern: "^(arn:aws(-cn)?:billingconductor::[0-9]{12}:pricingplan/)?[a-zA-Z0-9]{10}$")
            try self.pricingRuleArns.forEach {
                try validate($0, name: "pricingRuleArns[]", parent: name, pattern: "^(arn:aws(-cn)?:billingconductor::[0-9]{12}:pricingrule/)?[a-zA-Z0-9]{10}$")
            }
            try self.validate(self.pricingRuleArns, name: "pricingRuleArns", parent: name, max: 30)
            try self.validate(self.pricingRuleArns, name: "pricingRuleArns", parent: name, min: 1)
        }

        private enum CodingKeys: String, CodingKey {
            case arn = "Arn"
            case pricingRuleArns = "PricingRuleArns"
        }
    }

    public struct AssociatePricingRulesOutput: AWSDecodableShape {
        ///  The PricingPlanArn that the PricingRuleArns are associated with.
        public let arn: String?

        public init(arn: String? = nil) {
            self.arn = arn
        }

        private enum CodingKeys: String, CodingKey {
            case arn = "Arn"
        }
    }

    public struct AssociateResourceError: AWSDecodableShape {
        ///  The reason why the resource association failed.
        public let message: String?
        ///  A static error code that's used to classify the type of failure.
        public let reason: AssociateResourceErrorReason?

        public init(message: String? = nil, reason: AssociateResourceErrorReason? = nil) {
            self.message = message
            self.reason = reason
        }

        private enum CodingKeys: String, CodingKey {
            case message = "Message"
            case reason = "Reason"
        }
    }

    public struct AssociateResourceResponseElement: AWSDecodableShape {
        ///  The resource ARN that was associated to the custom line item.
        public let arn: String?
        ///  An AssociateResourceError that will populate if the resource association fails.
        public let error: AssociateResourceError?

        public init(arn: String? = nil, error: AssociateResourceError? = nil) {
            self.arn = arn
            self.error = error
        }

        private enum CodingKeys: String, CodingKey {
            case arn = "Arn"
            case error = "Error"
        }
    }

    public struct BatchAssociateResourcesToCustomLineItemInput: AWSEncodableShape {
        public let billingPeriodRange: CustomLineItemBillingPeriodRange?
        ///  A list containing the ARNs of the resources to be associated.
        public let resourceArns: [String]
        ///  A percentage custom line item ARN to associate the resources to.
        public let targetArn: String

        public init(billingPeriodRange: CustomLineItemBillingPeriodRange? = nil, resourceArns: [String], targetArn: String) {
            self.billingPeriodRange = billingPeriodRange
            self.resourceArns = resourceArns
            self.targetArn = targetArn
        }

        public func validate(name: String) throws {
            try self.billingPeriodRange?.validate(name: "\(name).billingPeriodRange")
            try self.resourceArns.forEach {
                try validate($0, name: "resourceArns[]", parent: name, pattern: "^(arn:aws(-cn)?:billingconductor::[0-9]{12}:(customlineitem|billinggroup)/)?[a-zA-Z0-9]{10,12}$")
            }
            try self.validate(self.resourceArns, name: "resourceArns", parent: name, max: 30)
            try self.validate(self.resourceArns, name: "resourceArns", parent: name, min: 1)
            try self.validate(self.targetArn, name: "targetArn", parent: name, pattern: "^(arn:aws(-cn)?:billingconductor::[0-9]{12}:customlineitem/)?[a-zA-Z0-9]{10}$")
        }

        private enum CodingKeys: String, CodingKey {
            case billingPeriodRange = "BillingPeriodRange"
            case resourceArns = "ResourceArns"
            case targetArn = "TargetArn"
        }
    }

    public struct BatchAssociateResourcesToCustomLineItemOutput: AWSDecodableShape {
        ///  A list of AssociateResourceResponseElement for each resource that failed association to a percentage custom line item.
        public let failedAssociatedResources: [AssociateResourceResponseElement]?
        ///  A list of AssociateResourceResponseElement for each resource that's been associated to a percentage custom line item successfully.
        public let successfullyAssociatedResources: [AssociateResourceResponseElement]?

        public init(failedAssociatedResources: [AssociateResourceResponseElement]? = nil, successfullyAssociatedResources: [AssociateResourceResponseElement]? = nil) {
            self.failedAssociatedResources = failedAssociatedResources
            self.successfullyAssociatedResources = successfullyAssociatedResources
        }

        private enum CodingKeys: String, CodingKey {
            case failedAssociatedResources = "FailedAssociatedResources"
            case successfullyAssociatedResources = "SuccessfullyAssociatedResources"
        }
    }

    public struct BatchDisassociateResourcesFromCustomLineItemInput: AWSEncodableShape {
        public let billingPeriodRange: CustomLineItemBillingPeriodRange?
        ///  A list containing the ARNs of resources to be disassociated.
        public let resourceArns: [String]
        ///  A percentage custom line item ARN to disassociate the resources from.
        public let targetArn: String

        public init(billingPeriodRange: CustomLineItemBillingPeriodRange? = nil, resourceArns: [String], targetArn: String) {
            self.billingPeriodRange = billingPeriodRange
            self.resourceArns = resourceArns
            self.targetArn = targetArn
        }

        public func validate(name: String) throws {
            try self.billingPeriodRange?.validate(name: "\(name).billingPeriodRange")
            try self.resourceArns.forEach {
                try validate($0, name: "resourceArns[]", parent: name, pattern: "^(arn:aws(-cn)?:billingconductor::[0-9]{12}:(customlineitem|billinggroup)/)?[a-zA-Z0-9]{10,12}$")
            }
            try self.validate(self.resourceArns, name: "resourceArns", parent: name, max: 30)
            try self.validate(self.resourceArns, name: "resourceArns", parent: name, min: 1)
            try self.validate(self.targetArn, name: "targetArn", parent: name, pattern: "^(arn:aws(-cn)?:billingconductor::[0-9]{12}:customlineitem/)?[a-zA-Z0-9]{10}$")
        }

        private enum CodingKeys: String, CodingKey {
            case billingPeriodRange = "BillingPeriodRange"
            case resourceArns = "ResourceArns"
            case targetArn = "TargetArn"
        }
    }

    public struct BatchDisassociateResourcesFromCustomLineItemOutput: AWSDecodableShape {
        ///  A list of DisassociateResourceResponseElement for each resource that failed disassociation from a percentage custom line item.
        public let failedDisassociatedResources: [DisassociateResourceResponseElement]?
        ///  A list of DisassociateResourceResponseElement for each resource that's been disassociated from a percentage custom line item successfully.
        public let successfullyDisassociatedResources: [DisassociateResourceResponseElement]?

        public init(failedDisassociatedResources: [DisassociateResourceResponseElement]? = nil, successfullyDisassociatedResources: [DisassociateResourceResponseElement]? = nil) {
            self.failedDisassociatedResources = failedDisassociatedResources
            self.successfullyDisassociatedResources = successfullyDisassociatedResources
        }

        private enum CodingKeys: String, CodingKey {
            case failedDisassociatedResources = "FailedDisassociatedResources"
            case successfullyDisassociatedResources = "SuccessfullyDisassociatedResources"
        }
    }

    public struct BillingGroupCostReportElement: AWSDecodableShape {
        /// The Amazon Resource Name (ARN) of a billing group.
        public let arn: String?
        /// The actual Amazon Web Services charges for the billing group.
        public let awsCost: String?
        /// The displayed currency.
        public let currency: String?
        ///  The billing group margin.
        public let margin: String?
        ///  The percentage of billing group margin.
        public let marginPercentage: String?
        /// The hypothetical Amazon Web Services charges based on the associated pricing plan of a billing group.
        public let proformaCost: String?

        public init(arn: String? = nil, awsCost: String? = nil, currency: String? = nil, margin: String? = nil, marginPercentage: String? = nil, proformaCost: String? = nil) {
            self.arn = arn
            self.awsCost = awsCost
            self.currency = currency
            self.margin = margin
            self.marginPercentage = marginPercentage
            self.proformaCost = proformaCost
        }

        private enum CodingKeys: String, CodingKey {
            case arn = "Arn"
            case awsCost = "AWSCost"
            case currency = "Currency"
            case margin = "Margin"
            case marginPercentage = "MarginPercentage"
            case proformaCost = "ProformaCost"
        }
    }

    public struct BillingGroupListElement: AWSDecodableShape {
        /// The Amazon Resource Number (ARN) that can be used to uniquely identify the billing group.
        public let arn: String?
        public let computationPreference: ComputationPreference?
        ///  The time when the billing group was created.
        public let creationTime: Int64?
        /// The description of the billing group.
        public let description: String?
        ///  The most recent time when the billing group was modified.
        public let lastModifiedTime: Int64?
        /// The name of the billing group.
        public let name: String?
        /// The account ID that serves as the main account in a billing group.
        public let primaryAccountId: String?
        /// The number of accounts in the particular billing group.
        public let size: Int64?
        /// The billing group status. Only one of the valid values can be used.
        public let status: BillingGroupStatus?
        /// The reason why the billing group is in its current status.
        public let statusReason: String?

        public init(arn: String? = nil, computationPreference: ComputationPreference? = nil, creationTime: Int64? = nil, description: String? = nil, lastModifiedTime: Int64? = nil, name: String? = nil, primaryAccountId: String? = nil, size: Int64? = nil, status: BillingGroupStatus? = nil, statusReason: String? = nil) {
            self.arn = arn
            self.computationPreference = computationPreference
            self.creationTime = creationTime
            self.description = description
            self.lastModifiedTime = lastModifiedTime
            self.name = name
            self.primaryAccountId = primaryAccountId
            self.size = size
            self.status = status
            self.statusReason = statusReason
        }

        private enum CodingKeys: String, CodingKey {
            case arn = "Arn"
            case computationPreference = "ComputationPreference"
            case creationTime = "CreationTime"
            case description = "Description"
            case lastModifiedTime = "LastModifiedTime"
            case name = "Name"
            case primaryAccountId = "PrimaryAccountId"
            case size = "Size"
            case status = "Status"
            case statusReason = "StatusReason"
        }
    }

    public struct ComputationPreference: AWSEncodableShape & AWSDecodableShape {
        ///  The Amazon Resource Name (ARN) of the pricing plan that's used to compute the Amazon Web Services charges for a billing group.
        public let pricingPlanArn: String

        public init(pricingPlanArn: String) {
            self.pricingPlanArn = pricingPlanArn
        }

        public func validate(name: String) throws {
            try self.validate(self.pricingPlanArn, name: "pricingPlanArn", parent: name, pattern: "^arn:aws(-cn)?:billingconductor::[0-9]{12}:pricingplan/[a-zA-Z0-9]{10}$")
        }

        private enum CodingKeys: String, CodingKey {
            case pricingPlanArn = "PricingPlanArn"
        }
    }

    public struct CreateBillingGroupInput: AWSEncodableShape {
        public static var _encoding = [
            AWSMemberEncoding(label: "clientToken", location: .header("X-Amzn-Client-Token"))
        ]

        ///  The set of accounts that will be under the billing group. The set of accounts resemble the linked accounts in a consolidated family.
        public let accountGrouping: AccountGrouping
        ///  The token that is needed to support idempotency. Idempotency isn't currently supported, but will be implemented in a future update.
        public let clientToken: String?
        ///  The preferences and settings that will be used to compute the Amazon Web Services charges for a billing group.
        public let computationPreference: ComputationPreference
        /// The description of the billing group.
        public let description: String?
        ///  The billing group name. The names must be unique.
        public let name: String
        ///  The account ID that serves as the main account in a billing group.
        public let primaryAccountId: String?
        ///  A map that contains tag keys and tag values that are attached to a billing group. This feature isn't available during the beta.
        public let tags: [String: String]?

        public init(accountGrouping: AccountGrouping, clientToken: String? = CreateBillingGroupInput.idempotencyToken(), computationPreference: ComputationPreference, description: String? = nil, name: String, primaryAccountId: String? = nil, tags: [String: String]? = nil) {
            self.accountGrouping = accountGrouping
            self.clientToken = clientToken
            self.computationPreference = computationPreference
            self.description = description
            self.name = name
            self.primaryAccountId = primaryAccountId
            self.tags = tags
        }

        public func validate(name: String) throws {
            try self.accountGrouping.validate(name: "\(name).accountGrouping")
            try self.validate(self.clientToken, name: "clientToken", parent: name, max: 64)
            try self.validate(self.clientToken, name: "clientToken", parent: name, min: 1)
            try self.validate(self.clientToken, name: "clientToken", parent: name, pattern: "^[a-zA-Z0-9-]+$")
            try self.computationPreference.validate(name: "\(name).computationPreference")
            try self.validate(self.description, name: "description", parent: name, max: 1024)
            try self.validate(self.name, name: "name", parent: name, max: 128)
            try self.validate(self.name, name: "name", parent: name, min: 1)
            try self.validate(self.name, name: "name", parent: name, pattern: "^[a-zA-Z0-9_\\+=\\.\\-@]+$")
            try self.validate(self.primaryAccountId, name: "primaryAccountId", parent: name, pattern: "^[0-9]{12}$")
            try self.tags?.forEach {
                try validate($0.key, name: "tags.key", parent: name, max: 128)
                try validate($0.key, name: "tags.key", parent: name, min: 1)
                try validate($0.value, name: "tags[\"\($0.key)\"]", parent: name, max: 256)
            }
            try self.validate(self.tags, name: "tags", parent: name, max: 200)
            try self.validate(self.tags, name: "tags", parent: name, min: 1)
        }

        private enum CodingKeys: String, CodingKey {
            case accountGrouping = "AccountGrouping"
            case computationPreference = "ComputationPreference"
            case description = "Description"
            case name = "Name"
            case primaryAccountId = "PrimaryAccountId"
            case tags = "Tags"
        }
    }

    public struct CreateBillingGroupOutput: AWSDecodableShape {
        /// The Amazon Resource Name (ARN) of the created billing group.
        public let arn: String?

        public init(arn: String? = nil) {
            self.arn = arn
        }

        private enum CodingKeys: String, CodingKey {
            case arn = "Arn"
        }
    }

    public struct CreateCustomLineItemInput: AWSEncodableShape {
        public static var _encoding = [
            AWSMemberEncoding(label: "clientToken", location: .header("X-Amzn-Client-Token"))
        ]

        ///  The Amazon Resource Name (ARN) that references the billing group where the custom line item applies to.
        public let billingGroupArn: String
        ///  A time range for which the custom line item is effective.
        public let billingPeriodRange: CustomLineItemBillingPeriodRange?
        ///  A CustomLineItemChargeDetails that describes the charge details for a custom line item.
        public let chargeDetails: CustomLineItemChargeDetails
        ///  The token that is needed to support idempotency. Idempotency isn't currently supported, but will be implemented in a future update.
        public let clientToken: String?
        ///  The description of the custom line item. This is shown on the Bills page in association with the charge value.
        public let description: String
        ///  The name of the custom line item.
        public let name: String
        ///  A map that contains tag keys and tag values that are attached to a custom line item.
        public let tags: [String: String]?

        public init(billingGroupArn: String, billingPeriodRange: CustomLineItemBillingPeriodRange? = nil, chargeDetails: CustomLineItemChargeDetails, clientToken: String? = CreateCustomLineItemInput.idempotencyToken(), description: String, name: String, tags: [String: String]? = nil) {
            self.billingGroupArn = billingGroupArn
            self.billingPeriodRange = billingPeriodRange
            self.chargeDetails = chargeDetails
            self.clientToken = clientToken
            self.description = description
            self.name = name
            self.tags = tags
        }

        public func validate(name: String) throws {
            try self.validate(self.billingGroupArn, name: "billingGroupArn", parent: name, pattern: "^(arn:aws(-cn)?:billingconductor::[0-9]{12}:billinggroup/)?[0-9]{12}$")
            try self.billingPeriodRange?.validate(name: "\(name).billingPeriodRange")
            try self.chargeDetails.validate(name: "\(name).chargeDetails")
            try self.validate(self.clientToken, name: "clientToken", parent: name, max: 64)
            try self.validate(self.clientToken, name: "clientToken", parent: name, min: 1)
            try self.validate(self.clientToken, name: "clientToken", parent: name, pattern: "^[a-zA-Z0-9-]+$")
            try self.validate(self.description, name: "description", parent: name, max: 255)
            try self.validate(self.description, name: "description", parent: name, min: 1)
            try self.validate(self.name, name: "name", parent: name, max: 128)
            try self.validate(self.name, name: "name", parent: name, min: 1)
            try self.validate(self.name, name: "name", parent: name, pattern: "^[a-zA-Z0-9_\\+=\\.\\-@]+$")
            try self.tags?.forEach {
                try validate($0.key, name: "tags.key", parent: name, max: 128)
                try validate($0.key, name: "tags.key", parent: name, min: 1)
                try validate($0.value, name: "tags[\"\($0.key)\"]", parent: name, max: 256)
            }
            try self.validate(self.tags, name: "tags", parent: name, max: 200)
            try self.validate(self.tags, name: "tags", parent: name, min: 1)
        }

        private enum CodingKeys: String, CodingKey {
            case billingGroupArn = "BillingGroupArn"
            case billingPeriodRange = "BillingPeriodRange"
            case chargeDetails = "ChargeDetails"
            case description = "Description"
            case name = "Name"
            case tags = "Tags"
        }
    }

    public struct CreateCustomLineItemOutput: AWSDecodableShape {
        ///  The Amazon Resource Name (ARN) of the created custom line item.
        public let arn: String?

        public init(arn: String? = nil) {
            self.arn = arn
        }

        private enum CodingKeys: String, CodingKey {
            case arn = "Arn"
        }
    }

    public struct CreateFreeTierConfig: AWSEncodableShape {
        ///  Activate or deactivate Amazon Web Services Free Tier.
        public let activated: Bool

        public init(activated: Bool) {
            self.activated = activated
        }

        private enum CodingKeys: String, CodingKey {
            case activated = "Activated"
        }
    }

    public struct CreatePricingPlanInput: AWSEncodableShape {
        public static var _encoding = [
            AWSMemberEncoding(label: "clientToken", location: .header("X-Amzn-Client-Token"))
        ]

        ///  The token that is needed to support idempotency. Idempotency isn't currently supported, but will be implemented in a future update.
        public let clientToken: String?
        /// The description of the pricing plan.
        public let description: String?
        /// The name of the pricing plan. The names must be unique to each pricing plan.
        public let name: String
        ///  A list of Amazon Resource Names (ARNs) that define the pricing plan parameters.
        public let pricingRuleArns: [String]?
        ///  A map that contains tag keys and tag values that are attached to a pricing plan.
        public let tags: [String: String]?

        public init(clientToken: String? = CreatePricingPlanInput.idempotencyToken(), description: String? = nil, name: String, pricingRuleArns: [String]? = nil, tags: [String: String]? = nil) {
            self.clientToken = clientToken
            self.description = description
            self.name = name
            self.pricingRuleArns = pricingRuleArns
            self.tags = tags
        }

        public func validate(name: String) throws {
            try self.validate(self.clientToken, name: "clientToken", parent: name, max: 64)
            try self.validate(self.clientToken, name: "clientToken", parent: name, min: 1)
            try self.validate(self.clientToken, name: "clientToken", parent: name, pattern: "^[a-zA-Z0-9-]+$")
            try self.validate(self.description, name: "description", parent: name, max: 1024)
            try self.validate(self.name, name: "name", parent: name, max: 128)
            try self.validate(self.name, name: "name", parent: name, min: 1)
            try self.validate(self.name, name: "name", parent: name, pattern: "^[a-zA-Z0-9_\\+=\\.\\-@]+$")
            try self.pricingRuleArns?.forEach {
                try validate($0, name: "pricingRuleArns[]", parent: name, pattern: "^(arn:aws(-cn)?:billingconductor::[0-9]{12}:pricingrule/)?[a-zA-Z0-9]{10}$")
            }
            try self.validate(self.pricingRuleArns, name: "pricingRuleArns", parent: name, max: 30)
            try self.tags?.forEach {
                try validate($0.key, name: "tags.key", parent: name, max: 128)
                try validate($0.key, name: "tags.key", parent: name, min: 1)
                try validate($0.value, name: "tags[\"\($0.key)\"]", parent: name, max: 256)
            }
            try self.validate(self.tags, name: "tags", parent: name, max: 200)
            try self.validate(self.tags, name: "tags", parent: name, min: 1)
        }

        private enum CodingKeys: String, CodingKey {
            case description = "Description"
            case name = "Name"
            case pricingRuleArns = "PricingRuleArns"
            case tags = "Tags"
        }
    }

    public struct CreatePricingPlanOutput: AWSDecodableShape {
        /// The Amazon Resource Name (ARN) of the created pricing plan.
        public let arn: String?

        public init(arn: String? = nil) {
            self.arn = arn
        }

        private enum CodingKeys: String, CodingKey {
            case arn = "Arn"
        }
    }

    public struct CreatePricingRuleInput: AWSEncodableShape {
        public static var _encoding = [
            AWSMemberEncoding(label: "clientToken", location: .header("X-Amzn-Client-Token"))
        ]

        ///  The seller of services provided by Amazon Web Services, their affiliates, or third-party providers selling services via Amazon Web Services Marketplace.
        public let billingEntity: String?
        ///  The token that's needed to support idempotency. Idempotency isn't currently supported, but will be implemented in a future update.
        public let clientToken: String?
        ///  The pricing rule description.
        public let description: String?
        ///  A percentage modifier that's applied on the public pricing rates.
        public let modifierPercentage: Double?
        ///  The pricing rule name. The names must be unique to each pricing rule.
        public let name: String
        ///  The scope of pricing rule that indicates if it's globally applicable, or it's service-specific.
        public let scope: PricingRuleScope
        ///  If the Scope attribute is set to SERVICE, the attribute indicates which service the PricingRule is applicable for.
        public let service: String?
        ///  A map that contains tag keys and tag values that are attached to a pricing rule.
        public let tags: [String: String]?
        ///  The set of tiering configurations for the pricing rule.
        public let tiering: CreateTieringInput?
        ///  The type of pricing rule.
        public let type: PricingRuleType

        public init(billingEntity: String? = nil, clientToken: String? = CreatePricingRuleInput.idempotencyToken(), description: String? = nil, modifierPercentage: Double? = nil, name: String, scope: PricingRuleScope, service: String? = nil, tags: [String: String]? = nil, tiering: CreateTieringInput? = nil, type: PricingRuleType) {
            self.billingEntity = billingEntity
            self.clientToken = clientToken
            self.description = description
            self.modifierPercentage = modifierPercentage
            self.name = name
            self.scope = scope
            self.service = service
            self.tags = tags
            self.tiering = tiering
            self.type = type
        }

        public func validate(name: String) throws {
            try self.validate(self.billingEntity, name: "billingEntity", parent: name, pattern: "^[a-zA-Z0-9 ]+$")
            try self.validate(self.clientToken, name: "clientToken", parent: name, max: 64)
            try self.validate(self.clientToken, name: "clientToken", parent: name, min: 1)
            try self.validate(self.clientToken, name: "clientToken", parent: name, pattern: "^[a-zA-Z0-9-]+$")
            try self.validate(self.description, name: "description", parent: name, max: 1024)
            try self.validate(self.modifierPercentage, name: "modifierPercentage", parent: name, min: 0.0)
            try self.validate(self.name, name: "name", parent: name, max: 128)
            try self.validate(self.name, name: "name", parent: name, min: 1)
            try self.validate(self.name, name: "name", parent: name, pattern: "^[a-zA-Z0-9_\\+=\\.\\-@]+$")
            try self.validate(self.service, name: "service", parent: name, max: 128)
            try self.validate(self.service, name: "service", parent: name, min: 1)
            try self.validate(self.service, name: "service", parent: name, pattern: "^[a-zA-Z0-9]+$")
            try self.tags?.forEach {
                try validate($0.key, name: "tags.key", parent: name, max: 128)
                try validate($0.key, name: "tags.key", parent: name, min: 1)
                try validate($0.value, name: "tags[\"\($0.key)\"]", parent: name, max: 256)
            }
            try self.validate(self.tags, name: "tags", parent: name, max: 200)
            try self.validate(self.tags, name: "tags", parent: name, min: 1)
        }

        private enum CodingKeys: String, CodingKey {
            case billingEntity = "BillingEntity"
            case description = "Description"
            case modifierPercentage = "ModifierPercentage"
            case name = "Name"
            case scope = "Scope"
            case service = "Service"
            case tags = "Tags"
            case tiering = "Tiering"
            case type = "Type"
        }
    }

    public struct CreatePricingRuleOutput: AWSDecodableShape {
        ///  The Amazon Resource Name (ARN) of the created pricing rule.
        public let arn: String?

        public init(arn: String? = nil) {
            self.arn = arn
        }

        private enum CodingKeys: String, CodingKey {
            case arn = "Arn"
        }
    }

    public struct CreateTieringInput: AWSEncodableShape {
        ///  The possible Amazon Web Services Free Tier configurations.
        public let freeTier: CreateFreeTierConfig

        public init(freeTier: CreateFreeTierConfig) {
            self.freeTier = freeTier
        }

        private enum CodingKeys: String, CodingKey {
            case freeTier = "FreeTier"
        }
    }

    public struct CustomLineItemBillingPeriodRange: AWSEncodableShape {
        ///  The inclusive end billing period that defines a billing period range where a custom line is applied.
        public let exclusiveEndBillingPeriod: String?
        ///  The inclusive start billing period that defines a billing period range where a custom line is applied.
        public let inclusiveStartBillingPeriod: String

        public init(exclusiveEndBillingPeriod: String? = nil, inclusiveStartBillingPeriod: String) {
            self.exclusiveEndBillingPeriod = exclusiveEndBillingPeriod
            self.inclusiveStartBillingPeriod = inclusiveStartBillingPeriod
        }

        public func validate(name: String) throws {
            try self.validate(self.exclusiveEndBillingPeriod, name: "exclusiveEndBillingPeriod", parent: name, pattern: "^\\d{4}-(0?[1-9]|1[012])$")
            try self.validate(self.inclusiveStartBillingPeriod, name: "inclusiveStartBillingPeriod", parent: name, pattern: "^\\d{4}-(0?[1-9]|1[012])$")
        }

        private enum CodingKeys: String, CodingKey {
            case exclusiveEndBillingPeriod = "ExclusiveEndBillingPeriod"
            case inclusiveStartBillingPeriod = "InclusiveStartBillingPeriod"
        }
    }

    public struct CustomLineItemChargeDetails: AWSEncodableShape {
        ///  A CustomLineItemFlatChargeDetails that describes the charge details of a flat custom line item.
        public let flat: CustomLineItemFlatChargeDetails?
        ///  A CustomLineItemPercentageChargeDetails that describes the charge details of a percentage custom line item.
        public let percentage: CustomLineItemPercentageChargeDetails?
        ///  The type of the custom line item that indicates whether the charge is a fee or credit.
        public let type: CustomLineItemType

        public init(flat: CustomLineItemFlatChargeDetails? = nil, percentage: CustomLineItemPercentageChargeDetails? = nil, type: CustomLineItemType) {
            self.flat = flat
            self.percentage = percentage
            self.type = type
        }

        public func validate(name: String) throws {
            try self.flat?.validate(name: "\(name).flat")
            try self.percentage?.validate(name: "\(name).percentage")
        }

        private enum CodingKeys: String, CodingKey {
            case flat = "Flat"
            case percentage = "Percentage"
            case type = "Type"
        }
    }

    public struct CustomLineItemFlatChargeDetails: AWSEncodableShape {
        ///  The custom line item's fixed charge value in USD.
        public let chargeValue: Double

        public init(chargeValue: Double) {
            self.chargeValue = chargeValue
        }

        public func validate(name: String) throws {
            try self.validate(self.chargeValue, name: "chargeValue", parent: name, max: 1_000_000.0)
            try self.validate(self.chargeValue, name: "chargeValue", parent: name, min: 0.0)
        }

        private enum CodingKeys: String, CodingKey {
            case chargeValue = "ChargeValue"
        }
    }

    public struct CustomLineItemListElement: AWSDecodableShape {
        ///  The Amazon Resource Names (ARNs) for custom line items.
        public let arn: String?
        ///  The number of resources that are associated to the custom line item.
        public let associationSize: Int64?
        ///  The Amazon Resource Name (ARN) that references the billing group where the custom line item applies to.
        public let billingGroupArn: String?
        ///  A ListCustomLineItemChargeDetails that describes the charge details of a custom line item.
        public let chargeDetails: ListCustomLineItemChargeDetails?
        ///  The time created.
        public let creationTime: Int64?
        ///  The custom line item's charge value currency. Only one of the valid values can be used.
        public let currencyCode: CurrencyCode?
        ///  The custom line item's description. This is shown on the Bills page in association with the charge value.
        public let description: String?
        ///  The most recent time when the custom line item was modified.
        public let lastModifiedTime: Int64?
        ///  The custom line item's name.
        public let name: String?
        ///  The product code that's associated with the custom line item.
        public let productCode: String?

        public init(arn: String? = nil, associationSize: Int64? = nil, billingGroupArn: String? = nil, chargeDetails: ListCustomLineItemChargeDetails? = nil, creationTime: Int64? = nil, currencyCode: CurrencyCode? = nil, description: String? = nil, lastModifiedTime: Int64? = nil, name: String? = nil, productCode: String? = nil) {
            self.arn = arn
            self.associationSize = associationSize
            self.billingGroupArn = billingGroupArn
            self.chargeDetails = chargeDetails
            self.creationTime = creationTime
            self.currencyCode = currencyCode
            self.description = description
            self.lastModifiedTime = lastModifiedTime
            self.name = name
            self.productCode = productCode
        }

        private enum CodingKeys: String, CodingKey {
            case arn = "Arn"
            case associationSize = "AssociationSize"
            case billingGroupArn = "BillingGroupArn"
            case chargeDetails = "ChargeDetails"
            case creationTime = "CreationTime"
            case currencyCode = "CurrencyCode"
            case description = "Description"
            case lastModifiedTime = "LastModifiedTime"
            case name = "Name"
            case productCode = "ProductCode"
        }
    }

    public struct CustomLineItemPercentageChargeDetails: AWSEncodableShape {
        ///  A list of resource ARNs to associate to the percentage custom line item.
        public let associatedValues: [String]?
        ///  The custom line item's percentage value. This will be multiplied against the combined value of its associated resources to determine its charge value.
        public let percentageValue: Double

        public init(associatedValues: [String]? = nil, percentageValue: Double) {
            self.associatedValues = associatedValues
            self.percentageValue = percentageValue
        }

        public func validate(name: String) throws {
            try self.associatedValues?.forEach {
                try validate($0, name: "associatedValues[]", parent: name, pattern: "^(arn:aws(-cn)?:billingconductor::[0-9]{12}:(customlineitem|billinggroup)/)?[a-zA-Z0-9]{10,12}$")
            }
            try self.validate(self.associatedValues, name: "associatedValues", parent: name, max: 5)
            try self.validate(self.percentageValue, name: "percentageValue", parent: name, max: 10000.0)
            try self.validate(self.percentageValue, name: "percentageValue", parent: name, min: 0.0)
        }

        private enum CodingKeys: String, CodingKey {
            case associatedValues = "AssociatedValues"
            case percentageValue = "PercentageValue"
        }
    }

    public struct CustomLineItemVersionListElement: AWSDecodableShape {
        /// The number of resources that are associated with the custom line item.
        public let associationSize: Int64?
        /// The Amazon Resource Name (ARN) of the billing group that the custom line item applies to.
        public let billingGroupArn: String?
        public let chargeDetails: ListCustomLineItemChargeDetails?
        /// The time when the custom line item version was created.
        public let creationTime: Int64?
        /// The charge value currency of the custom line item.
        public let currencyCode: CurrencyCode?
        /// The description of the custom line item.
        public let description: String?
        /// The end billing period of the custom line item version.
        public let endBillingPeriod: String?
        /// The most recent time that the custom line item version was modified.
        public let lastModifiedTime: Int64?
        /// The name of the custom line item.
        public let name: String?
        /// The product code that’s associated with the custom line item.
        public let productCode: String?
        /// The start billing period of the custom line item version.
        public let startBillingPeriod: String?

        public init(associationSize: Int64? = nil, billingGroupArn: String? = nil, chargeDetails: ListCustomLineItemChargeDetails? = nil, creationTime: Int64? = nil, currencyCode: CurrencyCode? = nil, description: String? = nil, endBillingPeriod: String? = nil, lastModifiedTime: Int64? = nil, name: String? = nil, productCode: String? = nil, startBillingPeriod: String? = nil) {
            self.associationSize = associationSize
            self.billingGroupArn = billingGroupArn
            self.chargeDetails = chargeDetails
            self.creationTime = creationTime
            self.currencyCode = currencyCode
            self.description = description
            self.endBillingPeriod = endBillingPeriod
            self.lastModifiedTime = lastModifiedTime
            self.name = name
            self.productCode = productCode
            self.startBillingPeriod = startBillingPeriod
        }

        private enum CodingKeys: String, CodingKey {
            case associationSize = "AssociationSize"
            case billingGroupArn = "BillingGroupArn"
            case chargeDetails = "ChargeDetails"
            case creationTime = "CreationTime"
            case currencyCode = "CurrencyCode"
            case description = "Description"
            case endBillingPeriod = "EndBillingPeriod"
            case lastModifiedTime = "LastModifiedTime"
            case name = "Name"
            case productCode = "ProductCode"
            case startBillingPeriod = "StartBillingPeriod"
        }
    }

    public struct DeleteBillingGroupInput: AWSEncodableShape {
        /// The Amazon Resource Name (ARN) of the billing group that you're deleting.
        public let arn: String

        public init(arn: String) {
            self.arn = arn
        }

        public func validate(name: String) throws {
            try self.validate(self.arn, name: "arn", parent: name, pattern: "^(arn:aws(-cn)?:billingconductor::[0-9]{12}:billinggroup/)?[0-9]{12}$")
        }

        private enum CodingKeys: String, CodingKey {
            case arn = "Arn"
        }
    }

    public struct DeleteBillingGroupOutput: AWSDecodableShape {
        /// The Amazon Resource Name (ARN) of the deleted billing group.
        public let arn: String?

        public init(arn: String? = nil) {
            self.arn = arn
        }

        private enum CodingKeys: String, CodingKey {
            case arn = "Arn"
        }
    }

    public struct DeleteCustomLineItemInput: AWSEncodableShape {
        ///  The ARN of the custom line item to be deleted.
        public let arn: String
        public let billingPeriodRange: CustomLineItemBillingPeriodRange?

        public init(arn: String, billingPeriodRange: CustomLineItemBillingPeriodRange? = nil) {
            self.arn = arn
            self.billingPeriodRange = billingPeriodRange
        }

        public func validate(name: String) throws {
            try self.validate(self.arn, name: "arn", parent: name, pattern: "^(arn:aws(-cn)?:billingconductor::[0-9]{12}:customlineitem/)?[a-zA-Z0-9]{10}$")
            try self.billingPeriodRange?.validate(name: "\(name).billingPeriodRange")
        }

        private enum CodingKeys: String, CodingKey {
            case arn = "Arn"
            case billingPeriodRange = "BillingPeriodRange"
        }
    }

    public struct DeleteCustomLineItemOutput: AWSDecodableShape {
        ///  Then ARN of the deleted custom line item.
        public let arn: String?

        public init(arn: String? = nil) {
            self.arn = arn
        }

        private enum CodingKeys: String, CodingKey {
            case arn = "Arn"
        }
    }

    public struct DeletePricingPlanInput: AWSEncodableShape {
        /// The Amazon Resource Name (ARN) of the pricing plan that you're deleting.
        public let arn: String

        public init(arn: String) {
            self.arn = arn
        }

        public func validate(name: String) throws {
            try self.validate(self.arn, name: "arn", parent: name, pattern: "^(arn:aws(-cn)?:billingconductor::[0-9]{12}:pricingplan/)?[a-zA-Z0-9]{10}$")
        }

        private enum CodingKeys: String, CodingKey {
            case arn = "Arn"
        }
    }

    public struct DeletePricingPlanOutput: AWSDecodableShape {
        ///  The Amazon Resource Name (ARN) of the deleted pricing plan.
        public let arn: String?

        public init(arn: String? = nil) {
            self.arn = arn
        }

        private enum CodingKeys: String, CodingKey {
            case arn = "Arn"
        }
    }

    public struct DeletePricingRuleInput: AWSEncodableShape {
        ///  The Amazon Resource Name (ARN) of the pricing rule that you are deleting.
        public let arn: String

        public init(arn: String) {
            self.arn = arn
        }

        public func validate(name: String) throws {
            try self.validate(self.arn, name: "arn", parent: name, pattern: "^(arn:aws(-cn)?:billingconductor::[0-9]{12}:pricingrule/)?[a-zA-Z0-9]{10}$")
        }

        private enum CodingKeys: String, CodingKey {
            case arn = "Arn"
        }
    }

    public struct DeletePricingRuleOutput: AWSDecodableShape {
        ///  The Amazon Resource Name (ARN) of the deleted pricing rule.
        public let arn: String?

        public init(arn: String? = nil) {
            self.arn = arn
        }

        private enum CodingKeys: String, CodingKey {
            case arn = "Arn"
        }
    }

    public struct DisassociateAccountsInput: AWSEncodableShape {
        /// The array of account IDs to disassociate.
        public let accountIds: [String]
        /// The Amazon Resource Name (ARN) of the billing group that the array of account IDs will disassociate from.
        public let arn: String

        public init(accountIds: [String], arn: String) {
            self.accountIds = accountIds
            self.arn = arn
        }

        public func validate(name: String) throws {
            try self.accountIds.forEach {
                try validate($0, name: "accountIds[]", parent: name, pattern: "^[0-9]{12}$")
            }
            try self.validate(self.accountIds, name: "accountIds", parent: name, max: 30)
            try self.validate(self.accountIds, name: "accountIds", parent: name, min: 1)
            try self.validate(self.arn, name: "arn", parent: name, pattern: "^(arn:aws(-cn)?:billingconductor::[0-9]{12}:billinggroup/)?[0-9]{12}$")
        }

        private enum CodingKeys: String, CodingKey {
            case accountIds = "AccountIds"
            case arn = "Arn"
        }
    }

    public struct DisassociateAccountsOutput: AWSDecodableShape {
        /// The Amazon Resource Name (ARN) of the billing group that the array of account IDs is disassociated from.
        public let arn: String?

        public init(arn: String? = nil) {
            self.arn = arn
        }

        private enum CodingKeys: String, CodingKey {
            case arn = "Arn"
        }
    }

    public struct DisassociatePricingRulesInput: AWSEncodableShape {
        ///  The pricing plan Amazon Resource Name (ARN) to disassociate pricing rules from.
        public let arn: String
        ///  A list containing the Amazon Resource Name (ARN) of the pricing rules that will be disassociated.
        public let pricingRuleArns: [String]

        public init(arn: String, pricingRuleArns: [String]) {
            self.arn = arn
            self.pricingRuleArns = pricingRuleArns
        }

        public func validate(name: String) throws {
            try self.validate(self.arn, name: "arn", parent: name, pattern: "^(arn:aws(-cn)?:billingconductor::[0-9]{12}:pricingplan/)?[a-zA-Z0-9]{10}$")
            try self.pricingRuleArns.forEach {
                try validate($0, name: "pricingRuleArns[]", parent: name, pattern: "^(arn:aws(-cn)?:billingconductor::[0-9]{12}:pricingrule/)?[a-zA-Z0-9]{10}$")
            }
            try self.validate(self.pricingRuleArns, name: "pricingRuleArns", parent: name, max: 30)
            try self.validate(self.pricingRuleArns, name: "pricingRuleArns", parent: name, min: 1)
        }

        private enum CodingKeys: String, CodingKey {
            case arn = "Arn"
            case pricingRuleArns = "PricingRuleArns"
        }
    }

    public struct DisassociatePricingRulesOutput: AWSDecodableShape {
        ///  The Amazon Resource Name (ARN) of the pricing plan that the pricing rules successfully disassociated from.
        public let arn: String?

        public init(arn: String? = nil) {
            self.arn = arn
        }

        private enum CodingKeys: String, CodingKey {
            case arn = "Arn"
        }
    }

    public struct DisassociateResourceResponseElement: AWSDecodableShape {
        ///  The resource ARN that was disassociated from the custom line item.
        public let arn: String?
        ///  An AssociateResourceError that's shown if the resource disassociation fails.
        public let error: AssociateResourceError?

        public init(arn: String? = nil, error: AssociateResourceError? = nil) {
            self.arn = arn
            self.error = error
        }

        private enum CodingKeys: String, CodingKey {
            case arn = "Arn"
            case error = "Error"
        }
    }

    public struct FreeTierConfig: AWSDecodableShape {
        ///  Activate or deactivate Amazon Web Services Free Tier application.
        public let activated: Bool

        public init(activated: Bool) {
            self.activated = activated
        }

        private enum CodingKeys: String, CodingKey {
            case activated = "Activated"
        }
    }

    public struct ListAccountAssociationsFilter: AWSEncodableShape {
        ///  The Amazon Web Services account ID to filter on.
        public let accountId: String?
        ///  MONITORED: linked accounts that are associated to billing groups.  UNMONITORED: linked accounts that are not associated to billing groups.  Billing Group Arn: linked accounts that are associated to the provided Billing Group Arn.
        public let association: String?

        public init(accountId: String? = nil, association: String? = nil) {
            self.accountId = accountId
            self.association = association
        }

        public func validate(name: String) throws {
            try self.validate(self.accountId, name: "accountId", parent: name, pattern: "^[0-9]{12}$")
            try self.validate(self.association, name: "association", parent: name, pattern: "^((arn:aws(-cn)?:billingconductor::[0-9]{12}:billinggroup/)?[0-9]{12}|MONITORED|UNMONITORED)$")
        }

        private enum CodingKeys: String, CodingKey {
            case accountId = "AccountId"
            case association = "Association"
        }
    }

    public struct ListAccountAssociationsInput: AWSEncodableShape {
        ///  The preferred billing period to get account associations.
        public let billingPeriod: String?
        /// The filter on the account ID of the linked account, or any of the following:  MONITORED: linked accounts that are associated to billing groups.  UNMONITORED: linked accounts that aren't associated to billing groups.  Billing Group Arn: linked accounts that are associated to the provided billing group Arn.
        public let filters: ListAccountAssociationsFilter?
        ///  The pagination token that's used on subsequent calls to retrieve accounts.
        public let nextToken: String?

        public init(billingPeriod: String? = nil, filters: ListAccountAssociationsFilter? = nil, nextToken: String? = nil) {
            self.billingPeriod = billingPeriod
            self.filters = filters
            self.nextToken = nextToken
        }

        public func validate(name: String) throws {
            try self.validate(self.billingPeriod, name: "billingPeriod", parent: name, pattern: "^\\d{4}-(0?[1-9]|1[012])$")
            try self.filters?.validate(name: "\(name).filters")
        }

        private enum CodingKeys: String, CodingKey {
            case billingPeriod = "BillingPeriod"
            case filters = "Filters"
            case nextToken = "NextToken"
        }
    }

    public struct ListAccountAssociationsOutput: AWSDecodableShape {
        ///  The list of linked accounts in the payer account.
        public let linkedAccounts: [AccountAssociationsListElement]?
        ///  The pagination token that's used on subsequent calls to get accounts.
        public let nextToken: String?

        public init(linkedAccounts: [AccountAssociationsListElement]? = nil, nextToken: String? = nil) {
            self.linkedAccounts = linkedAccounts
            self.nextToken = nextToken
        }

        private enum CodingKeys: String, CodingKey {
            case linkedAccounts = "LinkedAccounts"
            case nextToken = "NextToken"
        }
    }

    public struct ListBillingGroupCostReportsFilter: AWSEncodableShape {
        /// The list of Amazon Resource Names (ARNs) used to filter billing groups to retrieve reports.
        public let billingGroupArns: [String]?

        public init(billingGroupArns: [String]? = nil) {
            self.billingGroupArns = billingGroupArns
        }

        public func validate(name: String) throws {
            try self.billingGroupArns?.forEach {
                try validate($0, name: "billingGroupArns[]", parent: name, pattern: "^(arn:aws(-cn)?:billingconductor::[0-9]{12}:billinggroup/)?[0-9]{12}$")
            }
            try self.validate(self.billingGroupArns, name: "billingGroupArns", parent: name, max: 100)
            try self.validate(self.billingGroupArns, name: "billingGroupArns", parent: name, min: 1)
        }

        private enum CodingKeys: String, CodingKey {
            case billingGroupArns = "BillingGroupArns"
        }
    }

    public struct ListBillingGroupCostReportsInput: AWSEncodableShape {
        /// The preferred billing period for your report.
        public let billingPeriod: String?
        /// A ListBillingGroupCostReportsFilter to specify billing groups to retrieve reports from.
        public let filters: ListBillingGroupCostReportsFilter?
        /// The maximum number of reports to retrieve.
        public let maxResults: Int?
        /// The pagination token that's used on subsequent calls to get reports.
        public let nextToken: String?

        public init(billingPeriod: String? = nil, filters: ListBillingGroupCostReportsFilter? = nil, maxResults: Int? = nil, nextToken: String? = nil) {
            self.billingPeriod = billingPeriod
            self.filters = filters
            self.maxResults = maxResults
            self.nextToken = nextToken
        }

        public func validate(name: String) throws {
            try self.validate(self.billingPeriod, name: "billingPeriod", parent: name, pattern: "^\\d{4}-(0?[1-9]|1[012])$")
            try self.filters?.validate(name: "\(name).filters")
            try self.validate(self.maxResults, name: "maxResults", parent: name, max: 100)
            try self.validate(self.maxResults, name: "maxResults", parent: name, min: 1)
        }

        private enum CodingKeys: String, CodingKey {
            case billingPeriod = "BillingPeriod"
            case filters = "Filters"
            case maxResults = "MaxResults"
            case nextToken = "NextToken"
        }
    }

    public struct ListBillingGroupCostReportsOutput: AWSDecodableShape {
        /// A list of BillingGroupCostReportElement retrieved.
        public let billingGroupCostReports: [BillingGroupCostReportElement]?
        /// The pagination token that's used on subsequent calls to get reports.
        public let nextToken: String?

        public init(billingGroupCostReports: [BillingGroupCostReportElement]? = nil, nextToken: String? = nil) {
            self.billingGroupCostReports = billingGroupCostReports
            self.nextToken = nextToken
        }

        private enum CodingKeys: String, CodingKey {
            case billingGroupCostReports = "BillingGroupCostReports"
            case nextToken = "NextToken"
        }
    }

    public struct ListBillingGroupsFilter: AWSEncodableShape {
        /// The list of billing group Amazon Resource Names (ARNs) to retrieve information.
        public let arns: [String]?
        /// The pricing plan Amazon Resource Names (ARNs) to retrieve information.
        public let pricingPlan: String?

        public init(arns: [String]? = nil, pricingPlan: String? = nil) {
            self.arns = arns
            self.pricingPlan = pricingPlan
        }

        public func validate(name: String) throws {
            try self.arns?.forEach {
                try validate($0, name: "arns[]", parent: name, pattern: "^(arn:aws(-cn)?:billingconductor::[0-9]{12}:billinggroup/)?[0-9]{12}$")
            }
            try self.validate(self.arns, name: "arns", parent: name, max: 100)
            try self.validate(self.arns, name: "arns", parent: name, min: 1)
            try self.validate(self.pricingPlan, name: "pricingPlan", parent: name, pattern: "^arn:aws(-cn)?:billingconductor::[0-9]{12}:pricingplan/[a-zA-Z0-9]{10}$")
        }

        private enum CodingKeys: String, CodingKey {
            case arns = "Arns"
            case pricingPlan = "PricingPlan"
        }
    }

    public struct ListBillingGroupsInput: AWSEncodableShape {
        /// The preferred billing period to get billing groups.
        public let billingPeriod: String?
        /// A ListBillingGroupsFilter that specifies the billing group and pricing plan to retrieve billing group information.
        public let filters: ListBillingGroupsFilter?
        /// The maximum number of billing groups to retrieve.
        public let maxResults: Int?
        /// The pagination token that's used on subsequent calls to get billing groups.
        public let nextToken: String?

        public init(billingPeriod: String? = nil, filters: ListBillingGroupsFilter? = nil, maxResults: Int? = nil, nextToken: String? = nil) {
            self.billingPeriod = billingPeriod
            self.filters = filters
            self.maxResults = maxResults
            self.nextToken = nextToken
        }

        public func validate(name: String) throws {
            try self.validate(self.billingPeriod, name: "billingPeriod", parent: name, pattern: "^\\d{4}-(0?[1-9]|1[012])$")
            try self.filters?.validate(name: "\(name).filters")
            try self.validate(self.maxResults, name: "maxResults", parent: name, max: 100)
            try self.validate(self.maxResults, name: "maxResults", parent: name, min: 1)
        }

        private enum CodingKeys: String, CodingKey {
            case billingPeriod = "BillingPeriod"
            case filters = "Filters"
            case maxResults = "MaxResults"
            case nextToken = "NextToken"
        }
    }

    public struct ListBillingGroupsOutput: AWSDecodableShape {
        /// A list of BillingGroupListElement retrieved.
        public let billingGroups: [BillingGroupListElement]?
        /// The pagination token that's used on subsequent calls to get billing groups.
        public let nextToken: String?

        public init(billingGroups: [BillingGroupListElement]? = nil, nextToken: String? = nil) {
            self.billingGroups = billingGroups
            self.nextToken = nextToken
        }

        private enum CodingKeys: String, CodingKey {
            case billingGroups = "BillingGroups"
            case nextToken = "NextToken"
        }
    }

    public struct ListCustomLineItemChargeDetails: AWSDecodableShape {
        ///  A ListCustomLineItemFlatChargeDetails that describes the charge details of a flat custom line item.
        public let flat: ListCustomLineItemFlatChargeDetails?
        ///  A ListCustomLineItemPercentageChargeDetails that describes the charge details of a percentage custom line item.
        public let percentage: ListCustomLineItemPercentageChargeDetails?
        ///  The type of the custom line item that indicates whether the charge is a fee or credit.
        public let type: CustomLineItemType

        public init(flat: ListCustomLineItemFlatChargeDetails? = nil, percentage: ListCustomLineItemPercentageChargeDetails? = nil, type: CustomLineItemType) {
            self.flat = flat
            self.percentage = percentage
            self.type = type
        }

        private enum CodingKeys: String, CodingKey {
            case flat = "Flat"
            case percentage = "Percentage"
            case type = "Type"
        }
    }

    public struct ListCustomLineItemFlatChargeDetails: AWSDecodableShape {
        ///  The custom line item's fixed charge value in USD.
        public let chargeValue: Double

        public init(chargeValue: Double) {
            self.chargeValue = chargeValue
        }

        private enum CodingKeys: String, CodingKey {
            case chargeValue = "ChargeValue"
        }
    }

    public struct ListCustomLineItemPercentageChargeDetails: AWSDecodableShape {
        ///  The custom line item's percentage value. This will be multiplied against the combined value of its associated resources to determine its charge value.
        public let percentageValue: Double

        public init(percentageValue: Double) {
            self.percentageValue = percentageValue
        }

        private enum CodingKeys: String, CodingKey {
            case percentageValue = "PercentageValue"
        }
    }

    public struct ListCustomLineItemVersionsBillingPeriodRangeFilter: AWSEncodableShape {
        /// The exclusive end billing period that defines a billing period range where a  custom line item version is applied.
        public let endBillingPeriod: String?
        /// The inclusive start billing period that defines a billing period range where  a custom line item version is applied.
        public let startBillingPeriod: String?

        public init(endBillingPeriod: String? = nil, startBillingPeriod: String? = nil) {
            self.endBillingPeriod = endBillingPeriod
            self.startBillingPeriod = startBillingPeriod
        }

        public func validate(name: String) throws {
            try self.validate(self.endBillingPeriod, name: "endBillingPeriod", parent: name, pattern: "^\\d{4}-(0?[1-9]|1[012])$")
            try self.validate(self.startBillingPeriod, name: "startBillingPeriod", parent: name, pattern: "^\\d{4}-(0?[1-9]|1[012])$")
        }

        private enum CodingKeys: String, CodingKey {
            case endBillingPeriod = "EndBillingPeriod"
            case startBillingPeriod = "StartBillingPeriod"
        }
    }

    public struct ListCustomLineItemVersionsFilter: AWSEncodableShape {
        /// The billing period range in which the custom line item version is applied.
        public let billingPeriodRange: ListCustomLineItemVersionsBillingPeriodRangeFilter?

        public init(billingPeriodRange: ListCustomLineItemVersionsBillingPeriodRangeFilter? = nil) {
            self.billingPeriodRange = billingPeriodRange
        }

        public func validate(name: String) throws {
            try self.billingPeriodRange?.validate(name: "\(name).billingPeriodRange")
        }

        private enum CodingKeys: String, CodingKey {
            case billingPeriodRange = "BillingPeriodRange"
        }
    }

    public struct ListCustomLineItemVersionsInput: AWSEncodableShape {
        /// The Amazon Resource Name (ARN) for the custom line item.
        public let arn: String
        /// A ListCustomLineItemVersionsFilter that specifies the billing period range in which the custom line item versions are applied.
        public let filters: ListCustomLineItemVersionsFilter?
        /// The maximum number of custom line item versions to retrieve.
        public let maxResults: Int?
        /// The pagination token that's used on subsequent calls to retrieve custom line item versions.
        public let nextToken: String?

        public init(arn: String, filters: ListCustomLineItemVersionsFilter? = nil, maxResults: Int? = nil, nextToken: String? = nil) {
            self.arn = arn
            self.filters = filters
            self.maxResults = maxResults
            self.nextToken = nextToken
        }

        public func validate(name: String) throws {
            try self.validate(self.arn, name: "arn", parent: name, pattern: "^(arn:aws(-cn)?:billingconductor::[0-9]{12}:customlineitem/)?[a-zA-Z0-9]{10}$")
            try self.filters?.validate(name: "\(name).filters")
            try self.validate(self.maxResults, name: "maxResults", parent: name, max: 100)
            try self.validate(self.maxResults, name: "maxResults", parent: name, min: 1)
        }

        private enum CodingKeys: String, CodingKey {
            case arn = "Arn"
            case filters = "Filters"
            case maxResults = "MaxResults"
            case nextToken = "NextToken"
        }
    }

    public struct ListCustomLineItemVersionsOutput: AWSDecodableShape {
        /// A list of CustomLineItemVersionListElements that are received.
        public let customLineItemVersions: [CustomLineItemVersionListElement]?
        /// The pagination token that's used on subsequent calls to retrieve custom line item versions.
        public let nextToken: String?

        public init(customLineItemVersions: [CustomLineItemVersionListElement]? = nil, nextToken: String? = nil) {
            self.customLineItemVersions = customLineItemVersions
            self.nextToken = nextToken
        }

        private enum CodingKeys: String, CodingKey {
            case customLineItemVersions = "CustomLineItemVersions"
            case nextToken = "NextToken"
        }
    }

    public struct ListCustomLineItemsFilter: AWSEncodableShape {
        ///  A list of custom line item ARNs to retrieve information.
        public let arns: [String]?
        ///  The billing group Amazon Resource Names (ARNs) to retrieve information.
        public let billingGroups: [String]?
        ///  A list of custom line items to retrieve information.
        public let names: [String]?

        public init(arns: [String]? = nil, billingGroups: [String]? = nil, names: [String]? = nil) {
            self.arns = arns
            self.billingGroups = billingGroups
            self.names = names
        }

        public func validate(name: String) throws {
            try self.arns?.forEach {
                try validate($0, name: "arns[]", parent: name, pattern: "^(arn:aws(-cn)?:billingconductor::[0-9]{12}:customlineitem/)?[a-zA-Z0-9]{10}$")
            }
            try self.validate(self.arns, name: "arns", parent: name, max: 100)
            try self.validate(self.arns, name: "arns", parent: name, min: 1)
            try self.billingGroups?.forEach {
                try validate($0, name: "billingGroups[]", parent: name, pattern: "^(arn:aws(-cn)?:billingconductor::[0-9]{12}:billinggroup/)?[0-9]{12}$")
            }
            try self.validate(self.billingGroups, name: "billingGroups", parent: name, max: 100)
            try self.validate(self.billingGroups, name: "billingGroups", parent: name, min: 1)
            try self.names?.forEach {
                try validate($0, name: "names[]", parent: name, max: 128)
                try validate($0, name: "names[]", parent: name, min: 1)
                try validate($0, name: "names[]", parent: name, pattern: "^[a-zA-Z0-9_\\+=\\.\\-@]+$")
            }
            try self.validate(self.names, name: "names", parent: name, max: 100)
            try self.validate(self.names, name: "names", parent: name, min: 1)
        }

        private enum CodingKeys: String, CodingKey {
            case arns = "Arns"
            case billingGroups = "BillingGroups"
            case names = "Names"
        }
    }

    public struct ListCustomLineItemsInput: AWSEncodableShape {
        ///  The preferred billing period to get custom line items (FFLIs).
        public let billingPeriod: String?
        /// A ListCustomLineItemsFilter that specifies the custom line item names and/or billing group Amazon Resource Names (ARNs) to retrieve FFLI information.
        public let filters: ListCustomLineItemsFilter?
        ///  The maximum number of billing groups to retrieve.
        public let maxResults: Int?
        ///  The pagination token that's used on subsequent calls to get custom line items (FFLIs).
        public let nextToken: String?

        public init(billingPeriod: String? = nil, filters: ListCustomLineItemsFilter? = nil, maxResults: Int? = nil, nextToken: String? = nil) {
            self.billingPeriod = billingPeriod
            self.filters = filters
            self.maxResults = maxResults
            self.nextToken = nextToken
        }

        public func validate(name: String) throws {
            try self.validate(self.billingPeriod, name: "billingPeriod", parent: name, pattern: "^\\d{4}-(0?[1-9]|1[012])$")
            try self.filters?.validate(name: "\(name).filters")
            try self.validate(self.maxResults, name: "maxResults", parent: name, max: 100)
            try self.validate(self.maxResults, name: "maxResults", parent: name, min: 1)
        }

        private enum CodingKeys: String, CodingKey {
            case billingPeriod = "BillingPeriod"
            case filters = "Filters"
            case maxResults = "MaxResults"
            case nextToken = "NextToken"
        }
    }

    public struct ListCustomLineItemsOutput: AWSDecodableShape {
        ///  A list of FreeFormLineItemListElements received.
        public let customLineItems: [CustomLineItemListElement]?
        ///  The pagination token that's used on subsequent calls to get custom line items (FFLIs).
        public let nextToken: String?

        public init(customLineItems: [CustomLineItemListElement]? = nil, nextToken: String? = nil) {
            self.customLineItems = customLineItems
            self.nextToken = nextToken
        }

        private enum CodingKeys: String, CodingKey {
            case customLineItems = "CustomLineItems"
            case nextToken = "NextToken"
        }
    }

    public struct ListPricingPlansAssociatedWithPricingRuleInput: AWSEncodableShape {
        ///  The pricing plan billing period for which associations will be listed.
        public let billingPeriod: String?
        ///  The optional maximum number of pricing rule associations to retrieve.
        public let maxResults: Int?
        ///  The optional pagination token returned by a previous call.
        public let nextToken: String?
        ///  The pricing rule Amazon Resource Name (ARN) for which associations will be listed.
        public let pricingRuleArn: String

        public init(billingPeriod: String? = nil, maxResults: Int? = nil, nextToken: String? = nil, pricingRuleArn: String) {
            self.billingPeriod = billingPeriod
            self.maxResults = maxResults
            self.nextToken = nextToken
            self.pricingRuleArn = pricingRuleArn
        }

        public func validate(name: String) throws {
            try self.validate(self.billingPeriod, name: "billingPeriod", parent: name, pattern: "^\\d{4}-(0?[1-9]|1[012])$")
            try self.validate(self.maxResults, name: "maxResults", parent: name, max: 100)
            try self.validate(self.maxResults, name: "maxResults", parent: name, min: 1)
            try self.validate(self.pricingRuleArn, name: "pricingRuleArn", parent: name, pattern: "^(arn:aws(-cn)?:billingconductor::[0-9]{12}:pricingrule/)?[a-zA-Z0-9]{10}$")
        }

        private enum CodingKeys: String, CodingKey {
            case billingPeriod = "BillingPeriod"
            case maxResults = "MaxResults"
            case nextToken = "NextToken"
            case pricingRuleArn = "PricingRuleArn"
        }
    }

    public struct ListPricingPlansAssociatedWithPricingRuleOutput: AWSDecodableShape {
        ///  The pricing plan billing period for which associations will be listed.
        public let billingPeriod: String?
        ///  The pagination token to be used on subsequent calls.
        public let nextToken: String?
        ///  The list containing pricing plans that are associated with the requested pricing rule.
        public let pricingPlanArns: [String]?
        ///  The pricing rule Amazon Resource Name (ARN) for which associations will be listed.
        public let pricingRuleArn: String?

        public init(billingPeriod: String? = nil, nextToken: String? = nil, pricingPlanArns: [String]? = nil, pricingRuleArn: String? = nil) {
            self.billingPeriod = billingPeriod
            self.nextToken = nextToken
            self.pricingPlanArns = pricingPlanArns
            self.pricingRuleArn = pricingRuleArn
        }

        private enum CodingKeys: String, CodingKey {
            case billingPeriod = "BillingPeriod"
            case nextToken = "NextToken"
            case pricingPlanArns = "PricingPlanArns"
            case pricingRuleArn = "PricingRuleArn"
        }
    }

    public struct ListPricingPlansFilter: AWSEncodableShape {
        /// A list of pricing plan Amazon Resource Names (ARNs) to retrieve information.
        public let arns: [String]?

        public init(arns: [String]? = nil) {
            self.arns = arns
        }

        public func validate(name: String) throws {
            try self.arns?.forEach {
                try validate($0, name: "arns[]", parent: name, pattern: "^(arn:aws(-cn)?:billingconductor::[0-9]{12}:pricingplan/)?[a-zA-Z0-9]{10}$")
            }
            try self.validate(self.arns, name: "arns", parent: name, max: 100)
            try self.validate(self.arns, name: "arns", parent: name, min: 1)
        }

        private enum CodingKeys: String, CodingKey {
            case arns = "Arns"
        }
    }

    public struct ListPricingPlansInput: AWSEncodableShape {
        /// The preferred billing period to get pricing plan.
        public let billingPeriod: String?
        /// A ListPricingPlansFilter that specifies the Amazon Resource Name (ARNs) of pricing plans to retrieve pricing plans information.
        public let filters: ListPricingPlansFilter?
        /// The maximum number of pricing plans to retrieve.
        public let maxResults: Int?
        /// The pagination token that's used on subsequent call to get pricing plans.
        public let nextToken: String?

        public init(billingPeriod: String? = nil, filters: ListPricingPlansFilter? = nil, maxResults: Int? = nil, nextToken: String? = nil) {
            self.billingPeriod = billingPeriod
            self.filters = filters
            self.maxResults = maxResults
            self.nextToken = nextToken
        }

        public func validate(name: String) throws {
            try self.validate(self.billingPeriod, name: "billingPeriod", parent: name, pattern: "^\\d{4}-(0?[1-9]|1[012])$")
            try self.filters?.validate(name: "\(name).filters")
            try self.validate(self.maxResults, name: "maxResults", parent: name, max: 100)
            try self.validate(self.maxResults, name: "maxResults", parent: name, min: 1)
        }

        private enum CodingKeys: String, CodingKey {
            case billingPeriod = "BillingPeriod"
            case filters = "Filters"
            case maxResults = "MaxResults"
            case nextToken = "NextToken"
        }
    }

    public struct ListPricingPlansOutput: AWSDecodableShape {
        ///  The billing period for which the described pricing plans are applicable.
        public let billingPeriod: String?
        /// The pagination token that's used on subsequent calls to get pricing plans.
        public let nextToken: String?
        /// A list of PricingPlanListElement retrieved.
        public let pricingPlans: [PricingPlanListElement]?

        public init(billingPeriod: String? = nil, nextToken: String? = nil, pricingPlans: [PricingPlanListElement]? = nil) {
            self.billingPeriod = billingPeriod
            self.nextToken = nextToken
            self.pricingPlans = pricingPlans
        }

        private enum CodingKeys: String, CodingKey {
            case billingPeriod = "BillingPeriod"
            case nextToken = "NextToken"
            case pricingPlans = "PricingPlans"
        }
    }

    public struct ListPricingRulesAssociatedToPricingPlanInput: AWSEncodableShape {
        ///  The billing period for which the pricing rule associations are to be listed.
        public let billingPeriod: String?
        /// The optional maximum number of pricing rule associations to retrieve.
        public let maxResults: Int?
        ///  The optional pagination token returned by a previous call.
        public let nextToken: String?
        ///  The Amazon Resource Name (ARN) of the pricing plan for which associations are to be listed.
        public let pricingPlanArn: String

        public init(billingPeriod: String? = nil, maxResults: Int? = nil, nextToken: String? = nil, pricingPlanArn: String) {
            self.billingPeriod = billingPeriod
            self.maxResults = maxResults
            self.nextToken = nextToken
            self.pricingPlanArn = pricingPlanArn
        }

        public func validate(name: String) throws {
            try self.validate(self.billingPeriod, name: "billingPeriod", parent: name, pattern: "^\\d{4}-(0?[1-9]|1[012])$")
            try self.validate(self.maxResults, name: "maxResults", parent: name, max: 100)
            try self.validate(self.maxResults, name: "maxResults", parent: name, min: 1)
            try self.validate(self.pricingPlanArn, name: "pricingPlanArn", parent: name, pattern: "^(arn:aws(-cn)?:billingconductor::[0-9]{12}:pricingplan/)?[a-zA-Z0-9]{10}$")
        }

        private enum CodingKeys: String, CodingKey {
            case billingPeriod = "BillingPeriod"
            case maxResults = "MaxResults"
            case nextToken = "NextToken"
            case pricingPlanArn = "PricingPlanArn"
        }
    }

    public struct ListPricingRulesAssociatedToPricingPlanOutput: AWSDecodableShape {
        ///  The billing period for which the pricing rule associations are listed.
        public let billingPeriod: String?
        ///  The pagination token to be used on subsequent calls.
        public let nextToken: String?
        ///  The Amazon Resource Name (ARN) of the pricing plan for which associations are listed.
        public let pricingPlanArn: String?
        ///  A list containing pricing rules that are associated with the requested pricing plan.
        public let pricingRuleArns: [String]?

        public init(billingPeriod: String? = nil, nextToken: String? = nil, pricingPlanArn: String? = nil, pricingRuleArns: [String]? = nil) {
            self.billingPeriod = billingPeriod
            self.nextToken = nextToken
            self.pricingPlanArn = pricingPlanArn
            self.pricingRuleArns = pricingRuleArns
        }

        private enum CodingKeys: String, CodingKey {
            case billingPeriod = "BillingPeriod"
            case nextToken = "NextToken"
            case pricingPlanArn = "PricingPlanArn"
            case pricingRuleArns = "PricingRuleArns"
        }
    }

    public struct ListPricingRulesFilter: AWSEncodableShape {
        ///  A list containing the pricing rule Amazon Resource Names (ARNs) to include in the API response.
        public let arns: [String]?

        public init(arns: [String]? = nil) {
            self.arns = arns
        }

        public func validate(name: String) throws {
            try self.arns?.forEach {
                try validate($0, name: "arns[]", parent: name, pattern: "^(arn:aws(-cn)?:billingconductor::[0-9]{12}:pricingrule/)?[a-zA-Z0-9]{10}$")
            }
            try self.validate(self.arns, name: "arns", parent: name, max: 100)
            try self.validate(self.arns, name: "arns", parent: name, min: 1)
        }

        private enum CodingKeys: String, CodingKey {
            case arns = "Arns"
        }
    }

    public struct ListPricingRulesInput: AWSEncodableShape {
        ///  The preferred billing period to get the pricing plan.
        public let billingPeriod: String?
        ///  A DescribePricingRuleFilter that specifies the Amazon Resource Name (ARNs) of pricing rules to retrieve pricing rules information.
        public let filters: ListPricingRulesFilter?
        ///  The maximum number of pricing rules to retrieve.
        public let maxResults: Int?
        ///  The pagination token that's used on subsequent call to get pricing rules.
        public let nextToken: String?

        public init(billingPeriod: String? = nil, filters: ListPricingRulesFilter? = nil, maxResults: Int? = nil, nextToken: String? = nil) {
            self.billingPeriod = billingPeriod
            self.filters = filters
            self.maxResults = maxResults
            self.nextToken = nextToken
        }

        public func validate(name: String) throws {
            try self.validate(self.billingPeriod, name: "billingPeriod", parent: name, pattern: "^\\d{4}-(0?[1-9]|1[012])$")
            try self.filters?.validate(name: "\(name).filters")
            try self.validate(self.maxResults, name: "maxResults", parent: name, max: 100)
            try self.validate(self.maxResults, name: "maxResults", parent: name, min: 1)
        }

        private enum CodingKeys: String, CodingKey {
            case billingPeriod = "BillingPeriod"
            case filters = "Filters"
            case maxResults = "MaxResults"
            case nextToken = "NextToken"
        }
    }

    public struct ListPricingRulesOutput: AWSDecodableShape {
        ///  The billing period for which the described pricing rules are applicable.
        public let billingPeriod: String?
        ///  The pagination token that's used on subsequent calls to get pricing rules.
        public let nextToken: String?
        ///  A list containing the described pricing rules.
        public let pricingRules: [PricingRuleListElement]?

        public init(billingPeriod: String? = nil, nextToken: String? = nil, pricingRules: [PricingRuleListElement]? = nil) {
            self.billingPeriod = billingPeriod
            self.nextToken = nextToken
            self.pricingRules = pricingRules
        }

        private enum CodingKeys: String, CodingKey {
            case billingPeriod = "BillingPeriod"
            case nextToken = "NextToken"
            case pricingRules = "PricingRules"
        }
    }

    public struct ListResourcesAssociatedToCustomLineItemFilter: AWSEncodableShape {
        ///  The type of relationship between the custom line item and the associated resource.
        public let relationship: CustomLineItemRelationship?

        public init(relationship: CustomLineItemRelationship? = nil) {
            self.relationship = relationship
        }

        private enum CodingKeys: String, CodingKey {
            case relationship = "Relationship"
        }
    }

    public struct ListResourcesAssociatedToCustomLineItemInput: AWSEncodableShape {
        ///  The ARN of the custom line item for which the resource associations will be listed.
        public let arn: String
        ///  The billing period for which the resource associations will be listed.
        public let billingPeriod: String?
        ///  (Optional) A ListResourcesAssociatedToCustomLineItemFilter that can specify the types of resources that should be retrieved.
        public let filters: ListResourcesAssociatedToCustomLineItemFilter?
        ///  (Optional) The maximum number of resource associations to be retrieved.
        public let maxResults: Int?
        ///  (Optional) The pagination token that's returned by a previous request.
        public let nextToken: String?

        public init(arn: String, billingPeriod: String? = nil, filters: ListResourcesAssociatedToCustomLineItemFilter? = nil, maxResults: Int? = nil, nextToken: String? = nil) {
            self.arn = arn
            self.billingPeriod = billingPeriod
            self.filters = filters
            self.maxResults = maxResults
            self.nextToken = nextToken
        }

        public func validate(name: String) throws {
            try self.validate(self.arn, name: "arn", parent: name, pattern: "^(arn:aws(-cn)?:billingconductor::[0-9]{12}:customlineitem/)?[a-zA-Z0-9]{10}$")
            try self.validate(self.billingPeriod, name: "billingPeriod", parent: name, pattern: "^\\d{4}-(0?[1-9]|1[012])$")
            try self.validate(self.maxResults, name: "maxResults", parent: name, max: 100)
            try self.validate(self.maxResults, name: "maxResults", parent: name, min: 1)
        }

        private enum CodingKeys: String, CodingKey {
            case arn = "Arn"
            case billingPeriod = "BillingPeriod"
            case filters = "Filters"
            case maxResults = "MaxResults"
            case nextToken = "NextToken"
        }
    }

    public struct ListResourcesAssociatedToCustomLineItemOutput: AWSDecodableShape {
        ///  The custom line item ARN for which the resource associations are listed.
        public let arn: String?
        ///  A list of ListResourcesAssociatedToCustomLineItemResponseElement for each resource association retrieved.
        public let associatedResources: [ListResourcesAssociatedToCustomLineItemResponseElement]?
        ///  The pagination token to be used in subsequent requests to retrieve additional results.
        public let nextToken: String?

        public init(arn: String? = nil, associatedResources: [ListResourcesAssociatedToCustomLineItemResponseElement]? = nil, nextToken: String? = nil) {
            self.arn = arn
            self.associatedResources = associatedResources
            self.nextToken = nextToken
        }

        private enum CodingKeys: String, CodingKey {
            case arn = "Arn"
            case associatedResources = "AssociatedResources"
            case nextToken = "NextToken"
        }
    }

    public struct ListResourcesAssociatedToCustomLineItemResponseElement: AWSDecodableShape {
        ///  The ARN of the associated resource.
        public let arn: String?
        /// The end billing period of the associated resource.
        public let endBillingPeriod: String?
        ///  The type of relationship between the custom line item and the associated resource.
        public let relationship: CustomLineItemRelationship?

        public init(arn: String? = nil, endBillingPeriod: String? = nil, relationship: CustomLineItemRelationship? = nil) {
            self.arn = arn
            self.endBillingPeriod = endBillingPeriod
            self.relationship = relationship
        }

        private enum CodingKeys: String, CodingKey {
            case arn = "Arn"
            case endBillingPeriod = "EndBillingPeriod"
            case relationship = "Relationship"
        }
    }

    public struct ListTagsForResourceRequest: AWSEncodableShape {
        public static var _encoding = [
            AWSMemberEncoding(label: "resourceArn", location: .uri("ResourceArn"))
        ]

        ///  The Amazon Resource Name (ARN) that identifies the resource to list the tags.
        public let resourceArn: String

        public init(resourceArn: String) {
            self.resourceArn = resourceArn
        }

        public func validate(name: String) throws {
            try self.validate(self.resourceArn, name: "resourceArn", parent: name, max: 100)
            try self.validate(self.resourceArn, name: "resourceArn", parent: name, pattern: "^arn:aws(-cn)?:billingconductor::[0-9]{12}:billinggroup/?[0-9]{12}$|^arn:aws(-cn)?:billingconductor::[0-9]{12}:pricingplan/[a-zA-Z0-9]{10}$|^arn:aws(-cn)?:billingconductor::[0-9]{12}:pricingrule/[a-zA-Z0-9]{10}$|^(arn:aws(-cn)?:billingconductor::[0-9]{12}:customlineitem/)?[a-zA-Z0-9]{10}$")
        }

        private enum CodingKeys: CodingKey {}
    }

    public struct ListTagsForResourceResponse: AWSDecodableShape {
        ///  The tags for the resource.
        public let tags: [String: String]?

        public init(tags: [String: String]? = nil) {
            self.tags = tags
        }

        private enum CodingKeys: String, CodingKey {
            case tags = "Tags"
        }
    }

    public struct PricingPlanListElement: AWSDecodableShape {
        /// The pricing plan Amazon Resource Names (ARN). This can be used to uniquely identify a pricing plan.
        public let arn: String?
        ///  The time when the pricing plan was created.
        public let creationTime: Int64?
        /// The pricing plan description.
        public let description: String?
        ///  The most recent time when the pricing plan was modified.
        public let lastModifiedTime: Int64?
        /// The name of a pricing plan.
        public let name: String?
        ///  The pricing rules count that's currently associated with this pricing plan list element.
        public let size: Int64?

        public init(arn: String? = nil, creationTime: Int64? = nil, description: String? = nil, lastModifiedTime: Int64? = nil, name: String? = nil, size: Int64? = nil) {
            self.arn = arn
            self.creationTime = creationTime
            self.description = description
            self.lastModifiedTime = lastModifiedTime
            self.name = name
            self.size = size
        }

        private enum CodingKeys: String, CodingKey {
            case arn = "Arn"
            case creationTime = "CreationTime"
            case description = "Description"
            case lastModifiedTime = "LastModifiedTime"
            case name = "Name"
            case size = "Size"
        }
    }

    public struct PricingRuleListElement: AWSDecodableShape {
        ///  The Amazon Resource Name (ARN) used to uniquely identify a pricing rule.
        public let arn: String?
        ///  The pricing plans count that this pricing rule is associated with.
        public let associatedPricingPlanCount: Int64?
        ///  The seller of services provided by Amazon Web Services, their affiliates, or third-party providers selling services via Amazon Web Services Marketplace.
        public let billingEntity: String?
        ///  The time when the pricing rule was created.
        public let creationTime: Int64?
        ///  The pricing rule description.
        public let description: String?
        ///  The most recent time when the pricing rule was modified.
        public let lastModifiedTime: Int64?
        ///  A percentage modifier applied on the public pricing rates.
        public let modifierPercentage: Double?
        ///  The name of a pricing rule.
        public let name: String?
        ///  The scope of pricing rule that indicates if it is globally applicable, or if it is service-specific.
        public let scope: PricingRuleScope?
        ///  If the Scope attribute is SERVICE, this attribute indicates which service the PricingRule is applicable for.
        public let service: String?
        ///  The set of tiering configurations for the pricing rule.
        public let tiering: Tiering?
        ///  The type of pricing rule.
        public let type: PricingRuleType?

        public init(arn: String? = nil, associatedPricingPlanCount: Int64? = nil, billingEntity: String? = nil, creationTime: Int64? = nil, description: String? = nil, lastModifiedTime: Int64? = nil, modifierPercentage: Double? = nil, name: String? = nil, scope: PricingRuleScope? = nil, service: String? = nil, tiering: Tiering? = nil, type: PricingRuleType? = nil) {
            self.arn = arn
            self.associatedPricingPlanCount = associatedPricingPlanCount
            self.billingEntity = billingEntity
            self.creationTime = creationTime
            self.description = description
            self.lastModifiedTime = lastModifiedTime
            self.modifierPercentage = modifierPercentage
            self.name = name
            self.scope = scope
            self.service = service
            self.tiering = tiering
            self.type = type
        }

        private enum CodingKeys: String, CodingKey {
            case arn = "Arn"
            case associatedPricingPlanCount = "AssociatedPricingPlanCount"
            case billingEntity = "BillingEntity"
            case creationTime = "CreationTime"
            case description = "Description"
            case lastModifiedTime = "LastModifiedTime"
            case modifierPercentage = "ModifierPercentage"
            case name = "Name"
            case scope = "Scope"
            case service = "Service"
            case tiering = "Tiering"
            case type = "Type"
        }
    }

    public struct TagResourceRequest: AWSEncodableShape {
        public static var _encoding = [
            AWSMemberEncoding(label: "resourceArn", location: .uri("ResourceArn"))
        ]

        ///  The Amazon Resource Name (ARN) of the resource to which to add tags.
        public let resourceArn: String
        ///  The tags to add to the resource as a list of key-value pairs.
        public let tags: [String: String]

        public init(resourceArn: String, tags: [String: String]) {
            self.resourceArn = resourceArn
            self.tags = tags
        }

        public func validate(name: String) throws {
            try self.validate(self.resourceArn, name: "resourceArn", parent: name, max: 100)
            try self.validate(self.resourceArn, name: "resourceArn", parent: name, pattern: "^arn:aws(-cn)?:billingconductor::[0-9]{12}:billinggroup/?[0-9]{12}$|^arn:aws(-cn)?:billingconductor::[0-9]{12}:pricingplan/[a-zA-Z0-9]{10}$|^arn:aws(-cn)?:billingconductor::[0-9]{12}:pricingrule/[a-zA-Z0-9]{10}$|^(arn:aws(-cn)?:billingconductor::[0-9]{12}:customlineitem/)?[a-zA-Z0-9]{10}$")
            try self.tags.forEach {
                try validate($0.key, name: "tags.key", parent: name, max: 128)
                try validate($0.key, name: "tags.key", parent: name, min: 1)
                try validate($0.value, name: "tags[\"\($0.key)\"]", parent: name, max: 256)
            }
            try self.validate(self.tags, name: "tags", parent: name, max: 200)
            try self.validate(self.tags, name: "tags", parent: name, min: 1)
        }

        private enum CodingKeys: String, CodingKey {
            case tags = "Tags"
        }
    }

    public struct TagResourceResponse: AWSDecodableShape {
        public init() {}
    }

    public struct Tiering: AWSDecodableShape {
        ///  The possible Amazon Web Services Free Tier configurations.
        public let freeTier: FreeTierConfig

        public init(freeTier: FreeTierConfig) {
            self.freeTier = freeTier
        }

        private enum CodingKeys: String, CodingKey {
            case freeTier = "FreeTier"
        }
    }

    public struct UntagResourceRequest: AWSEncodableShape {
        public static var _encoding = [
            AWSMemberEncoding(label: "resourceArn", location: .uri("ResourceArn")),
            AWSMemberEncoding(label: "tagKeys", location: .querystring("tagKeys"))
        ]

        ///  The Amazon Resource Name (ARN) of the resource to which to delete tags.
        public let resourceArn: String
        ///  The tags to delete from the resource as a list of key-value pairs.
        public let tagKeys: [String]

        public init(resourceArn: String, tagKeys: [String]) {
            self.resourceArn = resourceArn
            self.tagKeys = tagKeys
        }

        public func validate(name: String) throws {
            try self.validate(self.resourceArn, name: "resourceArn", parent: name, max: 100)
            try self.validate(self.resourceArn, name: "resourceArn", parent: name, pattern: "^arn:aws(-cn)?:billingconductor::[0-9]{12}:billinggroup/?[0-9]{12}$|^arn:aws(-cn)?:billingconductor::[0-9]{12}:pricingplan/[a-zA-Z0-9]{10}$|^arn:aws(-cn)?:billingconductor::[0-9]{12}:pricingrule/[a-zA-Z0-9]{10}$|^(arn:aws(-cn)?:billingconductor::[0-9]{12}:customlineitem/)?[a-zA-Z0-9]{10}$")
            try self.tagKeys.forEach {
                try validate($0, name: "tagKeys[]", parent: name, max: 128)
                try validate($0, name: "tagKeys[]", parent: name, min: 1)
            }
            try self.validate(self.tagKeys, name: "tagKeys", parent: name, max: 200)
            try self.validate(self.tagKeys, name: "tagKeys", parent: name, min: 1)
        }

        private enum CodingKeys: CodingKey {}
    }

    public struct UntagResourceResponse: AWSDecodableShape {
        public init() {}
    }

    public struct UpdateBillingGroupInput: AWSEncodableShape {
        /// The Amazon Resource Name (ARN) of the billing group being updated.
        public let arn: String
        ///  The preferences and settings that will be used to compute the Amazon Web Services charges for a billing group.
        public let computationPreference: ComputationPreference?
        /// A description of the billing group.
        public let description: String?
        /// The name of the billing group. The names must be unique to each billing group.
        public let name: String?
        /// The status of the billing group. Only one of the valid values can be used.
        public let status: BillingGroupStatus?

        public init(arn: String, computationPreference: ComputationPreference? = nil, description: String? = nil, name: String? = nil, status: BillingGroupStatus? = nil) {
            self.arn = arn
            self.computationPreference = computationPreference
            self.description = description
            self.name = name
            self.status = status
        }

        public func validate(name: String) throws {
            try self.validate(self.arn, name: "arn", parent: name, pattern: "^(arn:aws(-cn)?:billingconductor::[0-9]{12}:billinggroup/)?[0-9]{12}$")
            try self.computationPreference?.validate(name: "\(name).computationPreference")
            try self.validate(self.description, name: "description", parent: name, max: 1024)
            try self.validate(self.name, name: "name", parent: name, max: 128)
            try self.validate(self.name, name: "name", parent: name, min: 1)
            try self.validate(self.name, name: "name", parent: name, pattern: "^[a-zA-Z0-9_\\+=\\.\\-@]+$")
        }

        private enum CodingKeys: String, CodingKey {
            case arn = "Arn"
            case computationPreference = "ComputationPreference"
            case description = "Description"
            case name = "Name"
            case status = "Status"
        }
    }

    public struct UpdateBillingGroupOutput: AWSDecodableShape {
        /// The Amazon Resource Name (ARN) of the billing group that was updated.
        public let arn: String?
        ///  A description of the billing group.
        public let description: String?
        ///  The most recent time when the billing group was modified.
        public let lastModifiedTime: Int64?
        ///  The name of the billing group. The names must be unique to each billing group.
        public let name: String?
        ///  The Amazon Resource Name (ARN) of the pricing plan to compute Amazon Web Services charges for the billing group.
        public let pricingPlanArn: String?
        ///  The account ID that serves as the main account in a billing group.
        public let primaryAccountId: String?
        ///  The number of accounts in the particular billing group.
        public let size: Int64?
        ///  The status of the billing group. Only one of the valid values can be used.
        public let status: BillingGroupStatus?
        ///  The reason why the billing group is in its current status.
        public let statusReason: String?

        public init(arn: String? = nil, description: String? = nil, lastModifiedTime: Int64? = nil, name: String? = nil, pricingPlanArn: String? = nil, primaryAccountId: String? = nil, size: Int64? = nil, status: BillingGroupStatus? = nil, statusReason: String? = nil) {
            self.arn = arn
            self.description = description
            self.lastModifiedTime = lastModifiedTime
            self.name = name
            self.pricingPlanArn = pricingPlanArn
            self.primaryAccountId = primaryAccountId
            self.size = size
            self.status = status
            self.statusReason = statusReason
        }

        private enum CodingKeys: String, CodingKey {
            case arn = "Arn"
            case description = "Description"
            case lastModifiedTime = "LastModifiedTime"
            case name = "Name"
            case pricingPlanArn = "PricingPlanArn"
            case primaryAccountId = "PrimaryAccountId"
            case size = "Size"
            case status = "Status"
            case statusReason = "StatusReason"
        }
    }

    public struct UpdateCustomLineItemChargeDetails: AWSEncodableShape {
        ///  An UpdateCustomLineItemFlatChargeDetails that describes the new charge details of a flat custom line item.
        public let flat: UpdateCustomLineItemFlatChargeDetails?
        ///  An UpdateCustomLineItemPercentageChargeDetails that describes the new charge details of a percentage custom line item.
        public let percentage: UpdateCustomLineItemPercentageChargeDetails?

        public init(flat: UpdateCustomLineItemFlatChargeDetails? = nil, percentage: UpdateCustomLineItemPercentageChargeDetails? = nil) {
            self.flat = flat
            self.percentage = percentage
        }

        public func validate(name: String) throws {
            try self.flat?.validate(name: "\(name).flat")
            try self.percentage?.validate(name: "\(name).percentage")
        }

        private enum CodingKeys: String, CodingKey {
            case flat = "Flat"
            case percentage = "Percentage"
        }
    }

    public struct UpdateCustomLineItemFlatChargeDetails: AWSEncodableShape {
        ///  The custom line item's new fixed charge value in USD.
        public let chargeValue: Double

        public init(chargeValue: Double) {
            self.chargeValue = chargeValue
        }

        public func validate(name: String) throws {
            try self.validate(self.chargeValue, name: "chargeValue", parent: name, max: 1_000_000.0)
            try self.validate(self.chargeValue, name: "chargeValue", parent: name, min: 0.0)
        }

        private enum CodingKeys: String, CodingKey {
            case chargeValue = "ChargeValue"
        }
    }

    public struct UpdateCustomLineItemInput: AWSEncodableShape {
        ///  The ARN of the custom line item to be updated.
        public let arn: String
        public let billingPeriodRange: CustomLineItemBillingPeriodRange?
        ///  A ListCustomLineItemChargeDetails containing the new charge details for the custom line item.
        public let chargeDetails: UpdateCustomLineItemChargeDetails?
        ///  The new line item description of the custom line item.
        public let description: String?
        ///  The new name for the custom line item.
        public let name: String?

        public init(arn: String, billingPeriodRange: CustomLineItemBillingPeriodRange? = nil, chargeDetails: UpdateCustomLineItemChargeDetails? = nil, description: String? = nil, name: String? = nil) {
            self.arn = arn
            self.billingPeriodRange = billingPeriodRange
            self.chargeDetails = chargeDetails
            self.description = description
            self.name = name
        }

        public func validate(name: String) throws {
            try self.validate(self.arn, name: "arn", parent: name, pattern: "^(arn:aws(-cn)?:billingconductor::[0-9]{12}:customlineitem/)?[a-zA-Z0-9]{10}$")
            try self.billingPeriodRange?.validate(name: "\(name).billingPeriodRange")
            try self.chargeDetails?.validate(name: "\(name).chargeDetails")
            try self.validate(self.description, name: "description", parent: name, max: 255)
            try self.validate(self.description, name: "description", parent: name, min: 1)
            try self.validate(self.name, name: "name", parent: name, max: 128)
            try self.validate(self.name, name: "name", parent: name, min: 1)
            try self.validate(self.name, name: "name", parent: name, pattern: "^[a-zA-Z0-9_\\+=\\.\\-@]+$")
        }

        private enum CodingKeys: String, CodingKey {
            case arn = "Arn"
            case billingPeriodRange = "BillingPeriodRange"
            case chargeDetails = "ChargeDetails"
            case description = "Description"
            case name = "Name"
        }
    }

    public struct UpdateCustomLineItemOutput: AWSDecodableShape {
        ///  The ARN of the successfully updated custom line item.
        public let arn: String?
        ///  The number of resources that are associated to the custom line item.
        public let associationSize: Int64?
        ///  The ARN of the billing group that the custom line item is applied to.
        public let billingGroupArn: String?
        ///  A ListCustomLineItemChargeDetails containing the charge details of the successfully updated custom line item.
        public let chargeDetails: ListCustomLineItemChargeDetails?
        ///  The description of the successfully updated custom line item.
        public let description: String?
        ///  The most recent time when the custom line item was modified.
        public let lastModifiedTime: Int64?
        ///  The name of the successfully updated custom line item.
        public let name: String?

        public init(arn: String? = nil, associationSize: Int64? = nil, billingGroupArn: String? = nil, chargeDetails: ListCustomLineItemChargeDetails? = nil, description: String? = nil, lastModifiedTime: Int64? = nil, name: String? = nil) {
            self.arn = arn
            self.associationSize = associationSize
            self.billingGroupArn = billingGroupArn
            self.chargeDetails = chargeDetails
            self.description = description
            self.lastModifiedTime = lastModifiedTime
            self.name = name
        }

        private enum CodingKeys: String, CodingKey {
            case arn = "Arn"
            case associationSize = "AssociationSize"
            case billingGroupArn = "BillingGroupArn"
            case chargeDetails = "ChargeDetails"
            case description = "Description"
            case lastModifiedTime = "LastModifiedTime"
            case name = "Name"
        }
    }

    public struct UpdateCustomLineItemPercentageChargeDetails: AWSEncodableShape {
        ///  The custom line item's new percentage value. This will be multiplied against the combined value of its associated resources to determine its charge value.
        public let percentageValue: Double

        public init(percentageValue: Double) {
            self.percentageValue = percentageValue
        }

        public func validate(name: String) throws {
            try self.validate(self.percentageValue, name: "percentageValue", parent: name, max: 10000.0)
            try self.validate(self.percentageValue, name: "percentageValue", parent: name, min: 0.0)
        }

        private enum CodingKeys: String, CodingKey {
            case percentageValue = "PercentageValue"
        }
    }

    public struct UpdateFreeTierConfig: AWSEncodableShape & AWSDecodableShape {
        ///  Activate or deactivate application of Amazon Web Services Free Tier.
        public let activated: Bool

        public init(activated: Bool) {
            self.activated = activated
        }

        private enum CodingKeys: String, CodingKey {
            case activated = "Activated"
        }
    }

    public struct UpdatePricingPlanInput: AWSEncodableShape {
        /// The Amazon Resource Name (ARN) of the pricing plan that you're updating.
        public let arn: String
        /// The description of the pricing plan.
        public let description: String?
        /// The name of the pricing plan. The name must be unique to each pricing plan.
        public let name: String?

        public init(arn: String, description: String? = nil, name: String? = nil) {
            self.arn = arn
            self.description = description
            self.name = name
        }

        public func validate(name: String) throws {
            try self.validate(self.arn, name: "arn", parent: name, pattern: "^(arn:aws(-cn)?:billingconductor::[0-9]{12}:pricingplan/)?[a-zA-Z0-9]{10}$")
            try self.validate(self.description, name: "description", parent: name, max: 1024)
            try self.validate(self.name, name: "name", parent: name, max: 128)
            try self.validate(self.name, name: "name", parent: name, min: 1)
            try self.validate(self.name, name: "name", parent: name, pattern: "^[a-zA-Z0-9_\\+=\\.\\-@]+$")
        }

        private enum CodingKeys: String, CodingKey {
            case arn = "Arn"
            case description = "Description"
            case name = "Name"
        }
    }

    public struct UpdatePricingPlanOutput: AWSDecodableShape {
        /// The Amazon Resource Name (ARN) of the updated pricing plan.
        public let arn: String?
        ///  The new description for the pricing rule.
        public let description: String?
        ///  The most recent time when the pricing plan was modified.
        public let lastModifiedTime: Int64?
        ///  The name of the pricing plan. The name must be unique to each pricing plan.
        public let name: String?
        ///  The pricing rules count that's currently associated with this pricing plan list.
        public let size: Int64?

        public init(arn: String? = nil, description: String? = nil, lastModifiedTime: Int64? = nil, name: String? = nil, size: Int64? = nil) {
            self.arn = arn
            self.description = description
            self.lastModifiedTime = lastModifiedTime
            self.name = name
            self.size = size
        }

        private enum CodingKeys: String, CodingKey {
            case arn = "Arn"
            case description = "Description"
            case lastModifiedTime = "LastModifiedTime"
            case name = "Name"
            case size = "Size"
        }
    }

    public struct UpdatePricingRuleInput: AWSEncodableShape {
        ///  The Amazon Resource Name (ARN) of the pricing rule to update.
        public let arn: String
        ///  The new description for the pricing rule.
        public let description: String?
        ///  The new modifier to show pricing plan rates as a percentage.
        public let modifierPercentage: Double?
        ///  The new name of the pricing rule. The name must be unique to each pricing rule.
        public let name: String?
        ///  The set of tiering configurations for the pricing rule.
        public let tiering: UpdateTieringInput?
        ///  The new pricing rule type.
        public let type: PricingRuleType?

        public init(arn: String, description: String? = nil, modifierPercentage: Double? = nil, name: String? = nil, tiering: UpdateTieringInput? = nil, type: PricingRuleType? = nil) {
            self.arn = arn
            self.description = description
            self.modifierPercentage = modifierPercentage
            self.name = name
            self.tiering = tiering
            self.type = type
        }

        public func validate(name: String) throws {
            try self.validate(self.arn, name: "arn", parent: name, pattern: "^(arn:aws(-cn)?:billingconductor::[0-9]{12}:pricingrule/)?[a-zA-Z0-9]{10}$")
            try self.validate(self.description, name: "description", parent: name, max: 1024)
            try self.validate(self.modifierPercentage, name: "modifierPercentage", parent: name, min: 0.0)
            try self.validate(self.name, name: "name", parent: name, max: 128)
            try self.validate(self.name, name: "name", parent: name, min: 1)
            try self.validate(self.name, name: "name", parent: name, pattern: "^[a-zA-Z0-9_\\+=\\.\\-@]+$")
        }

        private enum CodingKeys: String, CodingKey {
            case arn = "Arn"
            case description = "Description"
            case modifierPercentage = "ModifierPercentage"
            case name = "Name"
            case tiering = "Tiering"
            case type = "Type"
        }
    }

    public struct UpdatePricingRuleOutput: AWSDecodableShape {
        ///  The Amazon Resource Name (ARN) of the successfully updated pricing rule.
        public let arn: String?
        ///  The pricing plans count that this pricing rule is associated with.
        public let associatedPricingPlanCount: Int64?
        ///  The seller of services provided by Amazon Web Services, their affiliates, or third-party providers selling services via Amazon Web Services Marketplace.
        public let billingEntity: String?
        ///  The new description for the pricing rule.
        public let description: String?
        ///  The most recent time the pricing rule was modified.
        public let lastModifiedTime: Int64?
        ///  The new modifier to show pricing plan rates as a percentage.
        public let modifierPercentage: Double?
        ///  The new name of the pricing rule. The name must be unique to each pricing rule.
        public let name: String?
        ///  The scope of pricing rule that indicates if it's globally applicable, or it's service-specific.
        public let scope: PricingRuleScope?
        ///  If the Scope attribute is set to SERVICE, the attribute indicates which service the PricingRule is applicable for.
        public let service: String?
        ///  The set of tiering configurations for the pricing rule.
        public let tiering: UpdateTieringInput?
        ///  The new pricing rule type.
        public let type: PricingRuleType?

        public init(arn: String? = nil, associatedPricingPlanCount: Int64? = nil, billingEntity: String? = nil, description: String? = nil, lastModifiedTime: Int64? = nil, modifierPercentage: Double? = nil, name: String? = nil, scope: PricingRuleScope? = nil, service: String? = nil, tiering: UpdateTieringInput? = nil, type: PricingRuleType? = nil) {
            self.arn = arn
            self.associatedPricingPlanCount = associatedPricingPlanCount
            self.billingEntity = billingEntity
            self.description = description
            self.lastModifiedTime = lastModifiedTime
            self.modifierPercentage = modifierPercentage
            self.name = name
            self.scope = scope
            self.service = service
            self.tiering = tiering
            self.type = type
        }

        private enum CodingKeys: String, CodingKey {
            case arn = "Arn"
            case associatedPricingPlanCount = "AssociatedPricingPlanCount"
            case billingEntity = "BillingEntity"
            case description = "Description"
            case lastModifiedTime = "LastModifiedTime"
            case modifierPercentage = "ModifierPercentage"
            case name = "Name"
            case scope = "Scope"
            case service = "Service"
            case tiering = "Tiering"
            case type = "Type"
        }
    }

    public struct UpdateTieringInput: AWSEncodableShape & AWSDecodableShape {
        ///  The possible Amazon Web Services Free Tier configurations.
        public let freeTier: UpdateFreeTierConfig

        public init(freeTier: UpdateFreeTierConfig) {
            self.freeTier = freeTier
        }

        private enum CodingKeys: String, CodingKey {
            case freeTier = "FreeTier"
        }
    }
}

// MARK: - Errors

/// Error enum for Billingconductor
public struct BillingconductorErrorType: AWSErrorType {
    enum Code: String {
        case accessDeniedException = "AccessDeniedException"
        case conflictException = "ConflictException"
        case internalServerException = "InternalServerException"
        case resourceNotFoundException = "ResourceNotFoundException"
        case serviceLimitExceededException = "ServiceLimitExceededException"
        case throttlingException = "ThrottlingException"
        case validationException = "ValidationException"
    }

    private let error: Code
    public let context: AWSErrorContext?

    /// initialize Billingconductor
    public init?(errorCode: String, context: AWSErrorContext) {
        guard let error = Code(rawValue: errorCode) else { return nil }
        self.error = error
        self.context = context
    }

    internal init(_ error: Code) {
        self.error = error
        self.context = nil
    }

    /// return error code string
    public var errorCode: String { self.error.rawValue }

    /// You do not have sufficient access to perform this action.
    public static var accessDeniedException: Self { .init(.accessDeniedException) }
    /// You can cause an inconsistent state by updating or deleting a resource.
    public static var conflictException: Self { .init(.conflictException) }
    /// An unexpected error occurred while processing a request.
    public static var internalServerException: Self { .init(.internalServerException) }
    /// The request references a resource that doesn&#39;t exist.
    public static var resourceNotFoundException: Self { .init(.resourceNotFoundException) }
    /// The request would cause a service limit to exceed.
    public static var serviceLimitExceededException: Self { .init(.serviceLimitExceededException) }
    /// The request was denied due to request throttling.
    public static var throttlingException: Self { .init(.throttlingException) }
    /// The input doesn&#39;t match with the constraints specified by Amazon Web Services services.
    public static var validationException: Self { .init(.validationException) }
}

extension BillingconductorErrorType: Equatable {
    public static func == (lhs: BillingconductorErrorType, rhs: BillingconductorErrorType) -> Bool {
        lhs.error == rhs.error
    }
}

extension BillingconductorErrorType: CustomStringConvertible {
    public var description: String {
        return "\(self.error.rawValue): \(self.message ?? "")"
    }
}
